:root {
  /* Основной цвет: кнопки, выбранные вкладки, меню. */
  --navy: #1d3045;
  --navy-2: #12233a;
  --navy-3: #2a4360;
  --on-accent: #fff;
  --on-solid: #fff;
  /* Поверхности и линии. */
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-2: #fafbfc;
  --hover: #fafbfc;
  --btn-bg: var(--panel);
  --chip-bg: var(--panel);
  --input-bg: var(--panel);
  --sel: #eef3f8;
  --line: #dce2e8;
  --line-2: #e9edf1;
  --line-3: #c4ced8;
  --text: #1d3045;
  --muted: #66768a;
  --faint: #95a2b1;
  /* Смысловые цвета и их подложки. */
  --green: #2e7d5b;
  --green-bg: #e6f3ec;
  --green-line: #b9dcc9;
  --gold: #b07a2a;
  --gold-bg: #f8efe1;
  --red: #a23b3b;
  --red-bg: #f8e6e6;
  --blue: #2f6fb2;
  --blue-bg: #e6eff9;
  --blue-line: #c9dbf0;
  --violet: #6b4fa0;
  --violet-bg: #efeaf7;
  --orange: #c26a12;
  --orange-bg: #fcefe0;
  --orange-line: #f1d7b6;
  --wa: #1fa855;
  --line-app: #06c755;
  --note: #fff8df;
  --note-line: #efe0a8;
  --out: #e9f0f7;
  --out-line: #d3e0ec;
  --warn-text: #7a5200;
  --warn-line: #f0dfae;
  --crit-line: #efc4c4;
  --tint-warn: #fffbef;
  --tint-ok: #f3faf6;
  --sw-off: #c9d2db;
  --ring: rgba(47, 111, 178, 0.14);
  --focus: var(--blue);
  --overlay: rgba(18, 35, 58, 0.42);
  --hoverband: rgba(29, 48, 69, 0.05);
  --tabbar-bg: rgba(255, 255, 255, 0.96);
  /* Метки ролей и видов. */
  --t-gray-bg: #eceff2; --t-gray: #7b8794;
  --t-teal-bg: #e3f1f1; --t-teal: #1f6b69;
  --t-pink-bg: #fbe4f1; --t-pink: #a81f66;
  --t-rust-bg: #fbe6dc; --t-rust: #9a3d14;
  --t-blue-bg: #dbe7f6; --t-blue: #1c5cab;
  --t-green-bg: #dff3ea; --t-green: #0f6b4b;
  --t-violet-bg: #ebe7f7; --t-violet: #4a3aa7;
  --t-amber-bg: #fbefcf;
  /* Форма. */
  --radius: 10px;
  --ctl: 8px;
  --pill: 14px;
  --tag-r: 10px;
  --ctl-m: 10px;
  --pill-m: 17px;
  --shadow: 0 1px 2px rgba(18, 35, 58, 0.06), 0 4px 16px rgba(18, 35, 58, 0.06);
  --shadow-pop: 0 6px 24px rgba(18, 35, 58, 0.16);
  --card-shadow: none;
  /* Меню. */
  --side-w: 216px;
  --side-bg: var(--navy);
  --side-fg: #fff;
  --side-dim: rgba(255, 255, 255, 0.78);
  --side-hover: rgba(255, 255, 255, 0.07);
  --side-on: rgba(255, 255, 255, 0.13);
  --side-on-fg: #fff;
  --side-line: rgba(255, 255, 255, 0.12);
  --side-small: 0.6;
  --mark-bg: #fff;
  --mark-fg: var(--navy);
  --login-bg: var(--navy);
  --login-fg: rgba(255, 255, 255, 0.8);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-head: var(--font);
  --fs: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: var(--fs)/1.45 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
svg.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.ic.sm { width: 14px; height: 14px; }
svg.ic.lg { width: 22px; height: 22px; }

/* ---------- каркас ---------- */
.app { display: flex; height: 100vh; height: 100dvh; height: var(--app-h, 100dvh); overflow: hidden; }
.side {
  width: var(--side-w); flex: none; background: var(--side-bg); color: var(--side-fg);
  display: flex; flex-direction: column; padding: 16px 10px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: var(--ctl); background: var(--mark-bg); color: var(--mark-fg);
  display: grid; place-items: center; font-weight: 800; font-size: 11.5px; letter-spacing: -0.02em; flex: none;
}
.brand-name { font-weight: 700; letter-spacing: 0.01em; line-height: 1.1; }
.brand-name small { display: block; font-weight: 400; opacity: var(--side-small); font-size: 11.5px; margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--ctl);
  color: var(--side-dim); text-decoration: none; font-weight: 500;
}
.nav a:hover { background: var(--side-hover); color: var(--side-fg); }
.nav a.on { background: var(--side-on); color: var(--side-on-fg); }
.nav a.nav-help { margin-top: 0; }
.newdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #eda100; }
.nav .newdot { margin-left: auto; }
.tabbar a { position: relative; }
.tabbar .newdot { position: absolute; top: 6px; left: calc(50% + 9px); }
.nav .badge { margin-left: auto; }
.side-foot { margin-top: auto; padding: 10px 8px 0; border-top: 1px solid var(--side-line); font-size: 13px; }
.side-foot .who { opacity: 0.85; margin-bottom: 6px; }
.side-foot .who small { display: block; opacity: var(--side-small); font-size: 11.5px; }
.side-foot button { background: none; border: 0; color: var(--side-dim); padding: 0; }
.side-foot button:hover { color: var(--side-fg); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: var(--panel);
  border-bottom: 1px solid var(--line); min-height: 56px; flex: none;
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 700; white-space: nowrap; font-family: var(--font-head); }
.topbar .grow { flex: 1; }
.view { flex: 1; overflow: auto; }

.badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 700;
}
.badge.soft { background: rgba(255, 255, 255, 0.18); }
.badge.amber { background: var(--gold); color: var(--on-solid); }

/* ---------- элементы ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px;
  border-radius: var(--ctl); border: 1px solid var(--line); background: var(--btn-bg); color: var(--text); font-weight: 600;
  white-space: nowrap;
}
.btn:hover { border-color: var(--line-3); background: var(--hover); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: var(--on-accent); }
.btn.primary:hover { background: var(--navy-3); border-color: var(--navy-3); }
.btn.green { background: var(--green); border-color: var(--green); color: var(--on-solid); }
.btn.danger { color: var(--red); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--line-2); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 28px; }

.input, select.input, textarea.input {
  width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--ctl); background: var(--input-bg);
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.input { height: auto; padding: 9px 10px; resize: vertical; min-height: 80px; line-height: 1.45; }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--ring); }
.input.sm { height: 30px; font-size: 13px; }
label.field { display: block; }
label.field > span, div.field > span:first-child { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
div.field { display: block; }
.search { position: relative; max-width: 340px; width: 100%; }
.search svg { position: absolute; left: 10px; top: 9px; color: var(--faint); }
.search .input { padding-left: 34px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: var(--pill);
  border: 1px solid var(--line); background: var(--chip-bg); font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; text-decoration: none;
}
.chip:hover { color: var(--text); border-color: var(--line-3); }
.chip.on { background: var(--navy); border-color: var(--navy); color: var(--on-accent); }
.chip .n { font-size: 11px; opacity: 0.75; }
.chip .badge { height: 17px; min-width: 17px; font-size: 10px; }

.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: var(--tag-r); font-size: 11.5px;
  font-weight: 600; line-height: 18px; white-space: nowrap; background: var(--line-2); color: var(--muted);
}
.tag.employer { background: var(--blue-bg); color: var(--blue); }
.tag.partner { background: var(--gold-bg); color: var(--gold); }
.tag.candidate { background: var(--violet-bg); color: var(--violet); }
.tag.spam { background: var(--t-gray-bg); color: var(--t-gray); }
.tag.personal { background: var(--t-teal-bg); color: var(--t-teal); }
.tag.unsorted { background: var(--orange-bg); color: var(--orange); }
.tag.won { background: var(--green-bg); color: var(--green); }
.tag.lost { background: var(--red-bg); color: var(--red); }
.tag.test { background: var(--t-pink-bg); color: var(--t-pink); font-weight: 700; }
.tag.waiting { background: var(--orange-bg); color: var(--orange); }
.tag.owner { background: var(--line-2); color: var(--text); }
.tag svg.ic { width: 11px; height: 11px; }
.tag.as-btn { border: 0; cursor: pointer; font-family: inherit; }
.tag.as-btn:hover { filter: brightness(0.96); }

.ch { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 5px; color: var(--on-solid); flex: none; }
.ch svg { width: 12px; height: 12px; stroke-width: 2.2; }
.ch.whatsapp { background: var(--wa); }
.ch.email { background: var(--blue); }
.ch.line { background: var(--line-app); }
.ch.site { background: var(--navy); }
.ch.phone { background: var(--gold); }
.ch.note { background: #c9a227; }
.ch.system { background: var(--faint); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--card-shadow); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.spacer { flex: 1; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 36px; height: 36px; color: var(--faint); margin-bottom: 8px; }
.err { color: var(--red); }
.ok { color: var(--green); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700;
  font-size: 13px; color: var(--on-accent); background: var(--navy-3); position: relative;
}
.avatar .ch { position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border: 2px solid var(--panel); border-radius: 50%; }
.avatar .ch svg { width: 9px; height: 9px; }
.initials { width: 22px; height: 22px; border-radius: 50%; background: var(--line-2); color: var(--muted); font-size: 10px; font-weight: 700; display: inline-grid; place-items: center; flex: none; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy); color: var(--on-accent);
  padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); z-index: 100; max-width: 90vw;
}
.toast.error { background: var(--red); color: var(--on-solid); }

/* ---------- входящие ---------- */
.inbox { display: flex; height: 100%; }
.inbox-list { width: 400px; flex: none; border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.inbox-filters { padding: 12px 14px 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.inbox-filters .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px; }
.inbox-filters .chips::-webkit-scrollbar { display: none; }
.items { overflow-y: auto; flex: 1; }
.item {
  display: flex; gap: 11px; padding: 11px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer;
  text-decoration: none; color: inherit;
}
.item:hover { background: var(--hover); text-decoration: none; }
.item.on { background: var(--sel); }
.item .body { flex: 1; min-width: 0; }
.item .top { display: flex; align-items: center; gap: 6px; }
.item .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item.unread .title { font-weight: 800; }
.item .time { margin-left: auto; font-size: 12px; color: var(--faint); white-space: nowrap; }
.item.unread .time { color: var(--blue); font-weight: 600; }
.item .sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.item .prev { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 3px; }
.item.unread .prev { color: var(--text); }
.item .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); flex: none; margin-top: 6px; }
/* Имя крупно, номер или почта помельче под ним. */
.item .who { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; font-variant-numeric: tabular-nums; }
/* Клиент написал последним, мы не ответили: оранжевая полоса слева и подпись. */
.item.waiting { box-shadow: inset 3px 0 0 var(--orange); }
.item .wait { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 11.5px; font-weight: 600; color: var(--orange); }
.item .wait svg { width: 12px; height: 12px; }
.chips-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chips-row .chips { flex: 1; min-width: 0; }
.filter-toggle { display: none; position: relative; flex: none; }
.filter-toggle.has { border-color: var(--navy); color: var(--navy); }
.filter-toggle .badge { position: absolute; top: -6px; right: -6px; height: 16px; min-width: 16px; font-size: 10px; padding: 0 4px; }
.inbox-filters .filters { flex-wrap: wrap; }
.chip.wait-chip.on { background: var(--orange); border-color: var(--orange); color: var(--on-solid); }
.inbox-pane { flex: 1; min-width: 0; overflow: hidden; display: flex; }
.more { padding: 14px; text-align: center; }

/* ---------- карточка лида ---------- */
.lead { display: flex; flex-direction: column; flex: 1; min-width: 0; height: 100%; background: var(--bg); }
.lead-head { background: var(--panel); border-bottom: 1px solid var(--line); padding: 14px 20px 12px; }
.lead-title { display: flex; align-items: flex-start; gap: 10px; }
.lead-title h2 { margin: 0; font-size: 19px; line-height: 1.25; font-weight: 750; word-break: break-word; }
.lead-title .edit { border: 0; background: none; color: var(--faint); padding: 2px; }
.lead-name { min-width: 0; }
.lead-name h2 .tag { vertical-align: 3px; margin-left: 4px; }
.lead-sub { display: none; }
.side-ids { display: none; flex-direction: column; gap: 6px; font-size: 14px; }
.side-ids .idn { display: flex; align-items: center; gap: 8px; }
.lead-ids { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.lead-ids .idn { display: inline-flex; align-items: center; gap: 5px; }
.lead-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.lead-controls select.input { width: auto; height: 32px; font-size: 13px; padding-right: 26px; }
.lead-body { flex: 1; display: flex; min-height: 0; }
.lead-feed { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lead-side { width: 300px; flex: none; border-left: 1px solid var(--line); background: var(--panel); overflow-y: auto; padding: 14px 16px 24px; }
.lead-side h4 { margin: 18px 0 8px; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.lead-side h4:first-child { margin-top: 0; }
.kv { display: grid; grid-template-columns: 1fr; gap: 8px; }
.kv .input { height: 32px; font-size: 13px; }
.kv textarea.input { min-height: 70px; font-size: 13px; }

.sortbar { margin: 14px 20px 0; padding: 12px 14px; border-radius: var(--radius); background: var(--orange-bg); border: 1px solid var(--orange-line); }
.sortbar b { display: block; margin-bottom: 8px; }
.sortbar .chips .chip { background: var(--panel); }
.sortbar .chip.suggest { border-color: var(--orange); color: var(--orange); font-weight: 700; }

.ai { margin: 14px 20px 0; padding: 12px 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.ai-h { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); width: 100%; border: 0; background: none; padding: 0; text-align: left; }
.ai-h .faint { font-weight: 500; }
.ai.closed { padding: 8px 14px; }
.ai.closed p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; font-size: 13px; color: var(--muted); }
.ai p { margin: 6px 0 0; white-space: pre-wrap; }
.ai .qs { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.ai .q { text-align: left; border: 1px dashed var(--line-3); background: var(--hover); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.ai .q:hover { border-color: var(--blue); background: var(--blue-bg); }

.feed { flex: 1; overflow-y: auto; padding: 14px 20px 20px; }
.day { text-align: center; margin: 16px 0 10px; }
.day span { font-size: 12px; color: var(--faint); background: var(--bg); padding: 0 10px; font-weight: 600; }
.msg { display: flex; margin: 8px 0; }
.msg.out { justify-content: flex-end; }
.bubble {
  max-width: min(640px, 82%); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px 7px;
  box-shadow: 0 1px 1px rgba(18, 35, 58, 0.03); min-width: 120px;
}
.msg.out .bubble { background: var(--out); border-color: var(--out-line); }
.msg.note .bubble { background: var(--note); border-color: var(--note-line); max-width: 100%; width: 100%; }
.msg.failed .bubble { border-color: var(--crit-line); background: var(--st-crit-bg); }
.bubble .meta { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--faint); margin-bottom: 4px; }
.bubble .meta b { color: var(--muted); font-weight: 600; }
.bubble .subj { font-weight: 700; margin-bottom: 3px; }
.bubble .text { white-space: pre-wrap; word-break: break-word; }
.bubble .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; font-size: 11px; color: var(--faint); }
.bubble .st.read { color: var(--blue); }
.bubble .st.failed { color: var(--red); font-weight: 600; }
.bubble .atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bubble .att { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); font-size: 12.5px; max-width: 260px; }
.bubble .att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bubble img.thumb { max-width: 240px; max-height: 200px; border-radius: 8px; display: block; margin-top: 6px; }
.bubble .linkbtn { border: 0; background: none; padding: 0; color: var(--blue); font-size: 12.5px; }
.bubble iframe { width: 100%; height: 420px; border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; background: var(--panel); }
.sys { text-align: center; font-size: 12px; color: var(--faint); margin: 6px 0; }
.sys b { color: var(--muted); font-weight: 600; }

fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
.lead-controls select.input:disabled { opacity: 1; color: var(--text); background-color: var(--bg); }
fieldset.plain:disabled .input { background: var(--bg); color: var(--text); opacity: 1; -webkit-text-fill-color: var(--text); }
fieldset.plain:disabled .input::placeholder { color: transparent; -webkit-text-fill-color: transparent; }
fieldset.plain:disabled .chips, fieldset.plain:disabled button.chip { display: none; }
.pop.hide { display: none; }
.tag.demo { background: var(--violet-bg); color: var(--violet); gap: 5px; padding: 5px 10px; font-size: 12.5px; }
.ro-bar { display: flex; align-items: center; gap: 8px; flex: none; padding: 12px 20px; background: var(--panel); border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.waitbar { display: flex; align-items: center; gap: 10px; flex: none; padding: 7px 20px; background: var(--orange-bg); border-top: 1px solid var(--orange-line); color: var(--orange); font-size: 13px; font-weight: 600; }
.waitbar-t { display: inline-flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.waitbar .btn { background: var(--panel); flex: none; }
.waitbar + .composer { border-top-color: var(--orange-line); }
.composer { background: var(--panel); border-top: 1px solid var(--line); padding: 10px 20px 14px; flex: none; }
.composer .tabs { display: flex; gap: 2px; margin-bottom: 8px; flex-wrap: wrap; }
.composer .tab { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 6px 10px; border-radius: 7px; font-weight: 600; color: var(--muted); font-size: 13px; }
.composer .tab.on { background: var(--line-2); color: var(--text); }
.composer .tab:disabled { opacity: 0.4; cursor: default; }
.composer textarea.input { min-height: 74px; max-height: 40vh; }
.composer .hint { font-size: 12px; color: var(--muted); margin: 0 0 6px; display: flex; align-items: center; gap: 6px; }
.composer .hint.warn { color: var(--orange); }
.composer .bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.composer .opts { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.composer .opts label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.composer .files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pop { position: relative; }
.pop-back { position: fixed; inset: 0; z-index: 29; }
.pop-title { font-weight: 700; padding: 8px 10px 6px; }
.pop-menu.wide { min-width: 320px; }
.pop-menu.down.wide { width: 340px; }
.pop-menu button { display: flex; }
.pop-menu {
  position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 30; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow); min-width: 260px; max-width: 360px; max-height: 320px; overflow: auto; padding: 6px;
}
.pop-menu.down { bottom: auto; top: calc(100% + 6px); right: 0; left: auto; }
.pop-menu button { align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 7px; }
.pop-menu button:hover { background: var(--line-2); }
.pop-menu button small { display: block; flex: 1 1 100%; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop-menu .danger { color: var(--red); }

.drawer-back { position: fixed; inset: 0; background: var(--overlay); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(1080px, 94vw); z-index: 41; display: flex; box-shadow: -8px 0 30px rgba(18, 35, 58, 0.18); }
.drawer.narrow { width: min(560px, 100vw); }
.lead.sheet { background: var(--panel); }
.close-x { margin-left: auto; }

/* ---------- воронка ---------- */
.board-wrap { height: 100%; display: flex; flex-direction: column; }
.board-tools { display: flex; gap: 10px; align-items: center; padding: 12px 20px; flex-wrap: wrap; }
.board { flex: 1; display: flex; gap: 12px; overflow-x: auto; padding: 0 20px 20px; align-items: flex-start; }
.column { width: 268px; flex: none; background: var(--line-2); border-radius: 12px; display: flex; flex-direction: column; max-height: 100%; }
.column.drop { outline: 2px dashed var(--blue); outline-offset: -2px; background: var(--sel); }
.column-h { padding: 10px 12px 6px; display: flex; align-items: baseline; gap: 6px; font-weight: 700; }
.column-h .n { font-weight: 600; color: var(--muted); font-size: 12px; }
.column-h .sum { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 600; }
.column.won .column-h { color: var(--green); }
.column.lost .column-h { color: var(--red); }
.column.cold .column-h { color: var(--muted); }
.cards { padding: 4px 8px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.bcard { background: var(--panel); border-radius: 9px; padding: 9px 10px; box-shadow: 0 1px 2px rgba(18, 35, 58, 0.08); cursor: pointer; border: 1px solid transparent; }
.bcard:hover { border-color: var(--line-3); }
.bcard.dragging { opacity: 0.5; }
.bcard.waiting { box-shadow: inset 3px 0 0 var(--orange), 0 1px 2px rgba(18, 35, 58, 0.08); }
.bcard .t .tag { flex: none; }
.bcard .s.who, .lrow .s.who { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.bcard .f .wait { color: var(--orange); font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.bcard .t { font-weight: 650; display: flex; gap: 6px; align-items: center; }
.bcard .t span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bcard .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.bcard .f { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 11.5px; color: var(--faint); }
.bcard .f .late { color: var(--red); font-weight: 700; }
.bcard .f .due { color: var(--gold); font-weight: 700; }

/* ---------- дела, контакты, отчеты, настройки ---------- */
.page { padding: 18px 20px 40px; max-width: 1100px; }
.section { margin-bottom: 22px; }
.section-h { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--muted); }
.section-h.red { color: var(--red); }
.section-h.gold { color: var(--gold); }
.list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lrow { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
.lrow:last-child { border-bottom: 0; }
.lrow:hover { background: var(--hover); }
.lrow .main-c { flex: 1; min-width: 0; cursor: pointer; }
.lrow .main-c .t { font-weight: 600; }
.lrow .main-c .s { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .when { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.lrow .when.late { color: var(--red); font-weight: 600; }
.lrow .acts { display: flex; align-items: center; gap: 6px; flex: none; }
a.lrow, button.lrow { text-decoration: none; color: inherit; width: 100%; border-left: 0; border-right: 0; border-top: 0; background: none; text-align: left; font: inherit; }
a.lrow:hover { text-decoration: none; }
.lrow.danger { color: var(--red); }

table.tbl { width: 100%; border-collapse: collapse; background: var(--panel); }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--hover); }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.kpi .v { font-size: 26px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.1; }
.kpi .l { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bars { display: flex; flex-direction: column; gap: 7px; padding: 12px 14px; }
.bar { display: grid; grid-template-columns: 150px 1fr 36px; align-items: center; gap: 10px; font-size: 13px; }
.bar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .track { height: 10px; background: var(--line-2); border-radius: 5px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--navy-3); border-radius: 5px; }
.bar .num { text-align: right; font-weight: 700; }
.months { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding: 14px 14px 0; }
.mcol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.mstack { width: 100%; max-width: 44px; display: flex; flex-direction: column-reverse; border-radius: 5px 5px 0 0; overflow: hidden; }
.mstack div { width: 100%; }
.mcol .ml { font-size: 11.5px; color: var(--muted); padding-bottom: 8px; }
.mcol .mv { font-size: 12px; font-weight: 700; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 6px 14px 12px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.chan { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.chan-h { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.chan-h .tag { margin-left: auto; }
.chan p { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.copy { display: flex; gap: 6px; margin-top: 8px; }
.copy code { flex: 1; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; align-items: end; }
.log { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.log td { padding: 5px 10px; }

/* ---------- вход ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--login-bg); }
.login-card { width: 100%; max-width: 360px; background: var(--panel); border-radius: 14px; padding: 26px 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25); }
.login-card h1 { margin: 12px 0 16px; font-size: 20px; }
.login-card p { margin: 0 0 18px; color: var(--muted); }
.login-card .col { gap: 12px; }
.login-foot { margin: 16px 0 0 !important; }
.login-tip { margin: 12px 0 !important; line-height: 1.45; }
.brand-mark.big { width: 44px; height: 44px; font-size: 14px; border-radius: 10px; background: var(--navy); color: var(--on-accent); }
.btn.big { height: 44px; font-size: 15px; }
.invite-who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: -6px 0 14px; word-break: break-all; }

/* ---------- настройки: роли, приглашения, закрытые разделы ---------- */
.card.pad { padding: 14px; }
.avatar.lg { width: 44px; height: 44px; font-size: 16px; }
.locked-wrap { position: relative; }
.locked { opacity: 0.5; filter: grayscale(0.6); pointer-events: none; user-select: none; }
.locked-note { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--line-2); border-radius: 8px; padding: 4px 10px; margin-bottom: 8px; }
.role-note b { display: flex; align-items: center; gap: 6px; }
.linkbox { background: var(--green-bg); border: 1px solid var(--green-line); border-radius: var(--radius); padding: 12px 14px; }
.linkbox p { margin: 6px 0; }
.linkbox .copy code { background: var(--panel); }
.linkbox b { display: inline-flex; align-items: center; gap: 6px; }
.roles-help { display: grid; gap: 4px; margin-top: 12px; }
.roles-help b { color: var(--text); }
.switch { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.switch input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--navy); }
.switch span { display: block; }
.switch span .small { margin-top: 2px; }
.urow .acts { flex-wrap: wrap; justify-content: flex-end; }
.me-card { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.more-page .list { margin-bottom: 14px; }
.stage-nav { display: none; }
.only-phone { display: none !important; }
.modal-back { position: fixed; inset: 0; background: var(--overlay); z-index: 90; }
.modal { position: fixed; z-index: 91; left: 50%; top: 22vh; transform: translateX(-50%); width: min(400px, calc(100vw - 24px)); background: var(--panel); border-radius: 14px; padding: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); display: flex; flex-direction: column; gap: 10px; }
.modal b { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.modal p { margin: 0; color: var(--muted); }
.inbox-filters .filters select.input { min-width: 150px; }

/* ---------- мобильная версия ---------- */
.tabbar { display: none; }
.back { display: none; }
@media (max-width: 1100px) {
  .lead-side { display: none; }
  .lead-side.show { display: block; position: absolute; inset: 0; z-index: 5; width: auto; border: 0; }
  .lead-body { position: relative; }
  .only-wide { display: none !important; }
}
@media (min-width: 1101px) {
  .only-narrow { display: none !important; }
}

/* Телефон. Правила: палец попадает в любую кнопку (от 40 px), поля ввода 16 px
   (иначе iPhone приближает страницу), главное действие под большим пальцем. */
@media (max-width: 860px) {
  html { -webkit-text-size-adjust: 100%; }
  body { overscroll-behavior-y: none; }
  a, button, select, label { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
  .only-phone { display: inline-flex !important; }
  div.only-phone { display: block !important; }
  .not-phone { display: none !important; }

  .input, select.input, textarea.input, .input.sm { font-size: 16px; }
  .input, select.input { height: 44px; border-radius: var(--ctl-m); }
  .input.sm, select.input.sm { height: 40px; }
  .btn { height: 42px; border-radius: var(--ctl-m); }
  .btn.sm { height: 36px; font-size: 14px; padding: 0 12px; }
  .btn.icon { width: 42px; }
  .btn.sm.icon { width: 36px; }
  .chip { height: 34px; padding: 0 13px; font-size: 14px; border-radius: var(--pill-m); }
  label.field > span { font-size: 13px; }
  .small { font-size: 13px; }

  /* каркас */
  .side { display: none; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; background: var(--tabbar-bg);
    border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  }
  .tabbar a { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 7px; font-size: 10.5px; font-weight: 500; color: var(--muted); text-decoration: none; position: relative; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--navy); font-weight: 700; }
  .tabbar a.on svg { stroke-width: 2.2; }
  .tabbar .badge { position: absolute; top: 3px; left: calc(50% + 5px); height: 17px; min-width: 17px; font-size: 10.5px; padding: 0 4px; border: 2px solid var(--panel); box-sizing: content-box; }
  .main { padding-bottom: calc(57px + env(safe-area-inset-bottom)); }
  .topbar { padding: 8px 12px; min-height: 58px; gap: 8px; }
  .topbar h1 { font-size: 20px; }
  .topbar.has-search h1, .topbar.has-search .grow { display: none; }
  .topbar .search { max-width: none; flex: 1; }
  .topbar .search .input { height: 42px; border-radius: 21px; background: var(--bg); border-color: transparent; padding-left: 38px; }
  .topbar .search svg { left: 13px; top: 14px; }
  .topbar .add { width: 42px; padding: 0; border-radius: 50%; flex: none; }
  .topbar .add svg { width: 18px; height: 18px; }
  .view { -webkit-overflow-scrolling: touch; }
  .toast { bottom: calc(72px + env(safe-area-inset-bottom)); width: max-content; text-align: center; }
  .app.with-lead .toast { bottom: 24px; }

  /* входящие */
  .inbox-list { width: 100%; border-right: 0; }
  .inbox.has-lead .inbox-list { display: none; }
  .inbox:not(.has-lead) .inbox-pane { display: none; }
  .inbox-filters { padding: 10px 12px; gap: 8px; }
  .inbox-filters .chips { margin: 0 0 0 -12px; padding: 0 0 0 12px; }
  .filter-toggle { display: inline-flex; }
  .inbox-filters .filters { display: none; }
  .inbox-filters .filters.show { display: flex; }
  .inbox-filters .filters select.input { flex: 1 1 40% !important; }
  .item { padding: 12px 14px; gap: 12px; }
  .item:active { background: var(--sel); }
  .avatar { width: 44px; height: 44px; font-size: 15px; }
  .avatar .ch { width: 18px; height: 18px; }
  .avatar .ch svg { width: 10px; height: 10px; }
  .item .title { font-size: 16px; }
  .item .who { font-size: 13px; }
  .item .sub { font-size: 13px; }
  .item .prev { font-size: 14px; }
  .item .time { font-size: 12.5px; }
  .item .wait { font-size: 12.5px; }

  /* карточка лида */
  .back { display: inline-flex; }
  .lead-head { padding: 8px 10px 9px; }
  .lead-title { align-items: center; gap: 6px; }
  .lead-name { flex: 1; }
  .lead-title h2 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lead-sub { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
  .lead-name ~ .spacer { display: none; }
  .lead-title > input.input { flex: 1; min-width: 0; }
  .details-btn span { display: none; }
  .details-btn { width: 36px; padding: 0 !important; }
  .lead-ids { display: none; }
  .side-ids { display: flex; }
  .lead-controls { margin: 8px -10px 0; padding: 0 10px 1px; gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .lead-controls::-webkit-scrollbar { display: none; }
  .lead-controls select.input { flex: none; width: auto; max-width: 62vw; height: 34px; font-size: 14px; border-radius: 17px; background-color: var(--bg); padding: 0 26px 0 12px; }
  .lead-controls .tag, .lead-controls .btn, .lead-controls > span { flex: none; white-space: nowrap; }
  .lead-controls .tag { line-height: 26px; padding: 0 10px; border-radius: 14px; font-size: 12.5px; }
  .lead-controls .tag.test { font-size: 11px; }
  .sortbar, .ai { margin: 10px 10px 0; }
  .waitbar { padding: 6px 10px; }
  .ro-bar { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); font-size: 12.5px; }
  .waitbar .btn { min-height: 34px; }
  .feed { padding: 10px 10px 14px; -webkit-overflow-scrolling: touch; }
  .bubble { max-width: 88%; font-size: 15px; border-radius: 14px; }
  .bubble img.thumb { max-width: 100%; }
  .bubble .att { max-width: 100%; }
  .composer { padding: 6px 10px calc(8px + env(safe-area-inset-bottom)); }
  .composer .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -10px 6px; padding: 0 10px; }
  .composer .tabs::-webkit-scrollbar { display: none; }
  .composer .tab { padding: 7px 11px; font-size: 14px; white-space: nowrap; flex: none; }
  .composer .tab.off { display: none; }
  .composer textarea.input { min-height: 46px; max-height: 30vh; padding: 11px 12px; border-radius: 14px; }
  .composer .hint { font-size: 12px; align-items: flex-start; }
  .composer .hint svg { margin-top: 2px; }
  .composer .opts { gap: 10px; font-size: 13px; }
  .composer .bar { gap: 6px; }
  .composer .row { flex-wrap: wrap; }
  .composer .row select.input { max-width: none !important; }
  .btn.send { width: 46px; height: 46px; padding: 0; border-radius: 50%; }
  .btn.send span { display: none; }
  .btn.send svg { width: 18px; height: 18px; }
  .lead-side.show { position: fixed; inset: 0; z-index: 50; padding: 14px 14px calc(28px + env(safe-area-inset-bottom)); }
  .lead-side h4 { font-size: 12px; }
  .kv .input { height: 44px; font-size: 16px; }
  .kv textarea.input { font-size: 16px; min-height: 90px; }

  /* всплывающие меню - листом снизу */
  .pop-back { background: var(--overlay); z-index: 59; }
  .pop-menu, .pop-menu.down, .pop-menu.wide, .pop-menu.down.wide {
    position: fixed; left: 8px; right: 8px; top: auto; bottom: calc(8px + env(safe-area-inset-bottom)); width: auto; min-width: 0; max-width: none;
    max-height: 72vh; z-index: 60; border-radius: 16px; padding: 8px; box-shadow: 0 -8px 40px rgba(18, 35, 58, 0.25);
  }
  .pop-menu button { padding: 13px 12px; font-size: 15.5px; border-radius: 10px; }
  .pop-menu button svg { width: 18px; height: 18px; }
  .pop-menu button small { font-size: 13px; margin-top: 2px; }

  /* выезжающая карточка и новый лид - на весь экран */
  .drawer, .drawer.narrow { width: 100vw; box-shadow: none; }
  .app.with-lead .tabbar { display: none; }
  .app.with-lead .main { padding-bottom: 0; }
  .app.with-lead .topbar { display: none; }
  .form-grid { grid-template-columns: 1fr; }

  /* воронка: колонки листаются по одной */
  .board-tools { padding: 10px 12px; gap: 8px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .board-tools::-webkit-scrollbar { display: none; }
  .board-tools .chips { flex-wrap: nowrap; }
  .board-tools select.input { flex: none; }
  div.stage-nav.only-phone { display: flex !important; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 0 12px 10px; flex: none; }
  .stage-nav::-webkit-scrollbar { display: none; }
  .stage-nav .chip { flex: none; height: 30px; font-size: 13px; padding: 0 11px; }
  .stage-nav .chip.won { color: var(--green); }
  .stage-nav .chip.lost { color: var(--red); }
  .board { padding: 0 12px 14px; gap: 10px; scroll-snap-type: x mandatory; scroll-padding: 0 12px; }
  .column { width: 84vw; scroll-snap-align: start; }
  .bcard { padding: 11px 12px; }
  .bcard .t { font-size: 15px; }
  .bcard .s { font-size: 13px; }
  .bcard .f { font-size: 12px; }

  /* дела, контакты, отчеты, настройки */
  .page { padding: 12px 12px 30px; }
  .section-h { font-size: 12.5px; }
  .lrow { padding: 12px; gap: 10px; flex-wrap: wrap; }
  .lrow .main-c { flex: 1 1 60%; }
  .lrow .main-c .t { font-size: 15px; }
  .lrow .main-c .s { font-size: 13px; }
  .lrow .when { margin-left: 28px; }
  .lrow .acts { margin-left: auto; }
  .menu .lrow { flex-wrap: nowrap; padding: 14px; }
  .menu .lrow .main-c { flex: 1; }
  .urow { align-items: flex-start; }
  .urow .acts { flex: 1 1 100%; justify-content: flex-start; padding-left: 54px; }
  .urow .acts select.input { flex: 1; }
  table.contacts thead { display: none; }
  table.contacts, table.contacts tbody { display: block; }
  table.contacts tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 12px; border-bottom: 1px solid var(--line-2); }
  table.contacts tr:last-child { border-bottom: 0; }
  table.contacts td { display: block; padding: 0; border: 0; }
  table.contacts tr.click:hover td { background: transparent; }
  table.contacts td:nth-child(1) { font-size: 15px; }
  table.contacts td:nth-child(2) { grid-column: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
  table.contacts td:nth-child(5) { grid-column: 2; grid-row: 1; text-align: right; }
  .tbl .hide-m { display: none; }
  .tbl td, .tbl th { padding: 10px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 11px 12px; }
  .kpi .v { font-size: 23px; }
  .grid2 { grid-template-columns: 1fr; }
  .bar { grid-template-columns: 104px 1fr 30px; }
  .months { gap: 6px; padding: 12px 10px 0; }
  .settings-grid { grid-template-columns: 1fr; }
  .copy code { font-size: 12.5px; padding: 9px 8px; }
  .linkbox .copy { flex-direction: column; }
  .linkbox .copy code { white-space: normal; word-break: break-all; }
  .login { padding: 16px; align-items: start; padding-top: 12vh; }
  .login-card { padding: 24px 20px; }
}

/* ======================================================================
   SBL CRM: дашборд, список чатов, карточка чата, сотрудники, бот
   ====================================================================== */
:root {
  /* Цвета серий на графиках. Закреплены за сегментом или рядом и не меняются от фильтров. */
  --s-blue: #2a78d6;
  --s-orange: #eb6834;
  --s-aqua: #1baf7a;
  --s-yellow: #eda100;
  --s-magenta: #e87ba4;
  --s-gray: #a9b3bf;
  --s-violet: #4a3aa7;
  --s-brown: #9c6b3f;
  /* Состояния: срок, предупреждение. */
  --st-warn: #fab219;
  --st-warn-bg: #fdf3d8;
  --st-crit: #d03b3b;
  --st-crit-bg: #fbe9e9;
  --grid: #e6eaee;
}
.c-start { background: var(--s-violet); }
.c-active, .c-team { background: var(--s-blue); fill: var(--s-blue); }
.c-pause, .c-client { background: var(--s-orange); fill: var(--s-orange); }
.c-hold { background: var(--s-brown); fill: var(--s-brown); }
.c-termination { background: #8c1d1d; }
.c-denied { background: #5b6472; }
.c-done { background: var(--s-aqua); }
.c-kpp { background: var(--s-yellow); }
.c-unsorted { background: var(--s-magenta); }
.c-internal { background: var(--s-gray); }

.page.wide { max-width: 1320px; }
.pad { padding: 12px 14px; }
.nowrap { white-space: nowrap; }
.card-h { display: flex; align-items: baseline; gap: 10px; padding: 13px 14px 8px; font-weight: 700; font-size: 14.5px; }
.card-sub { font-weight: 400; font-size: 12.5px; color: var(--muted); }
.more-l { margin-left: auto; font-weight: 500; font-size: 12.5px; }
.dash .card { margin-bottom: 14px; overflow: hidden; }
.dash .grid2 { align-items: stretch; margin-bottom: 14px; }
.dash .grid2 .card { height: 100%; margin-bottom: 0; }
.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.filterbar select.input { width: auto; min-width: 190px; }

/* --- плитки с главными числами --- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 10px; color: inherit; text-decoration: none; }
.tile:hover { border-color: var(--line-3); text-decoration: none; box-shadow: var(--shadow); }
.tile-l { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.tile-v { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin-top: 4px; }
.tile-s { font-size: 12.5px; color: var(--muted); min-height: 18px; display: flex; align-items: center; gap: 4px; white-space: pre-wrap; }
.tile-s.warn { color: var(--warn-text); }
.tile-s.crit { color: var(--st-crit); font-weight: 600; }

/* --- сегменты одной полосой --- */
.segbar-wrap { padding: 4px 14px 14px; }
.segbar { display: flex; gap: 2px; height: 22px; border-radius: 5px; overflow: hidden; }
.segbar-part { min-width: 3px; display: block; }
.segbar-part:hover { filter: brightness(0.93); }
.legend.rows { display: grid; grid-template-columns: 1fr; gap: 0; padding: 10px 0 0; }
.legend .lg { display: grid; grid-template-columns: 14px 1fr auto 44px; align-items: center; gap: 8px; padding: 5px 0; color: var(--text); font-size: 13.5px; text-decoration: none; border-bottom: 1px solid var(--line-2); }
.legend .lg:last-child { border-bottom: 0; }
.legend .lg:hover .lg-l { text-decoration: underline; }
.legend .lg i { width: 10px; height: 10px; border-radius: 3px; margin: 0; }
.legend .lg b { font-variant-numeric: tabular-nums; }
.legend .lg-p { text-align: right; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* --- что проверить --- */
.rv { padding: 0 6px 8px; }
.rv-row { display: grid; grid-template-columns: 44px 1fr 16px; align-items: center; gap: 8px; padding: 8px; border-radius: 8px; color: var(--text); text-decoration: none; }
.rv-row:hover { background: var(--bg); text-decoration: none; }
.rv-row b { font-size: 18px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.rv-row span { font-size: 13.5px; }

/* --- ждут ответа --- */
.list.flat { border: 0; border-radius: 0; border-top: 1px solid var(--line-2); }
.meter-wrap { width: 170px; flex: none; }
.meter { height: 6px; border-radius: 3px; background: var(--t-blue-bg); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 3px; background: var(--s-blue); }
.meter.soon { background: var(--st-warn-bg); }
.meter.soon span { background: var(--st-warn); }
.meter.over { background: var(--st-crit-bg); }
.meter.over span { background: var(--st-crit); }
.meter-l { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
.meter-l.over { color: var(--st-crit); font-weight: 600; }

/* --- паузы --- */
.pz { padding: 0 14px 12px; }
.pz-h { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: none; margin: 10px 0 4px; }
.pz-h:first-child { margin-top: 0; }
.pz-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; color: var(--text); text-decoration: none; font-size: 13.5px; }
.pz-row:hover .pz-t { text-decoration: underline; }
.pz-d { width: 74px; flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.pz-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- график по неделям --- */
.chart { padding: 0 14px 12px; }
.chart .legend { padding: 0 0 6px; align-items: center; }
.chart-box { position: relative; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--line-3); stroke-width: 1; }
.chart .tick { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .hit { fill: transparent; outline: none; }
.chart .hit:focus-visible { stroke: var(--blue); stroke-width: 1.5; }
.chart .hoverband { fill: var(--hoverband); }
.chart path.c-team, .chart path.c-client { background: none; }
.tip { position: absolute; top: 6px; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 7px 10px; font-size: 12.5px; pointer-events: none; white-space: nowrap; z-index: 2; }
.tip > b { display: block; margin-bottom: 3px; }
.tip i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }
.tbl.nums td, .tbl.nums th { font-variant-numeric: tabular-nums; }

/* --- горизонтальные столбики: одна серия, один цвет --- */
.bars a.bar { color: inherit; text-decoration: none; }
.bars a.bar:hover .lbl { text-decoration: underline; }
.bars .bar .fill { display: block; background: var(--s-blue); border-radius: 0 4px 4px 0; }
.bars .bar .track { background: transparent; border-radius: 0; }

/* --- таблица нагрузки --- */
.tbl-wrap { overflow-x: auto; }
.staff-load td, .staff-load th { white-space: nowrap; padding: 7px 12px; vertical-align: middle; }
.staff-load td.name { font-weight: 600; }
.staff-load .barcell { width: 22%; min-width: 120px; }
.staff-load .track { display: flex; gap: 2px; height: 8px; }
.staff-load .fill { display: block; height: 100%; background: var(--s-blue); border-radius: 0 4px 4px 0; }
.staff-load .fill.light { background: var(--s-orange); }
.over-n { display: inline-flex; align-items: center; gap: 4px; color: var(--st-crit); font-weight: 700; }

/* --- метки --- */
.tag[class*='seg-'] { background: var(--line-2); color: var(--text); gap: 6px; }
.tag[class*='seg-']::before { content: ''; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tag.seg-start::before { background: var(--s-violet); }
.tag.seg-active::before { background: var(--s-blue); }
.tag.seg-pause::before { background: var(--s-orange); }
.tag.seg-hold::before { background: var(--s-brown); }
.tag.seg-termination::before { background: #8c1d1d; }
.tag.seg-denied::before { background: #5b6472; }
.tag.seg-done::before { background: var(--s-aqua); }
.tag.seg-kpp::before { background: var(--s-yellow); }
.tag.seg-unsorted::before { background: var(--s-magenta); }
.tag.seg-internal::before { background: var(--s-gray); }
.tag.unsure { border: 1px dashed var(--line-3); background: var(--panel); line-height: 16px; }
.tag .q { color: var(--muted); font-weight: 800; }
.tag.unsure-t { background: var(--st-warn-bg); color: var(--warn-text); }
.tag.tariff { background: var(--line-2); color: var(--text); }
.tag.case { background: var(--sel); color: var(--navy-3); }
.wait-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.wait-tag.soon { color: var(--warn-text); background: var(--st-warn-bg); padding: 1px 8px; border-radius: 10px; }
.wait-tag.over { color: var(--on-solid); background: var(--st-crit); padding: 1px 8px; border-radius: 10px; }
.wait-tag svg.ic { width: 12px; height: 12px; }

/* --- переключатель --- */
.sw { width: 38px; height: 22px; border-radius: 11px; border: 0; background: var(--sw-off); position: relative; padding: 0; flex: none; transition: background 0.15s; }
.sw i { position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.15s; }
.sw.on { background: var(--green); }
.sw.on i { transform: translateX(16px); }
.sw:disabled { opacity: 0.55; cursor: default; }
.sw:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
label.check input { width: 17px; height: 17px; accent-color: var(--navy); flex: none; }

/* --- список чатов --- */
.chats-page { display: flex; flex-direction: column; height: 100%; }
.chats-tools { background: var(--panel); border-bottom: 1px solid var(--line); padding: 12px 20px 10px; display: flex; flex-direction: column; gap: 10px; flex: none; }
.chips.tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.chips.tabs::-webkit-scrollbar { display: none; }
.chats-tools .filters select.input { width: auto; max-width: 210px; }
.filters-toggle { display: none !important; align-self: flex-start; }
.staff-tbl td.nums { white-space: nowrap; }
.chip.over-chip.on { background: var(--st-crit); border-color: var(--st-crit); color: var(--on-solid); }
.bulkbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; background: var(--sel); border: 1px solid var(--out-line); border-radius: 10px; }
.bulkbar select.input { width: auto; max-width: 190px; }
.chats-body { flex: 1; overflow: auto; }
table.chats { border-bottom: 1px solid var(--line); }
table.chats th { position: sticky; top: 0; z-index: 1; white-space: nowrap; }
table.chats td { vertical-align: middle; }
table.chats td.chk, table.chats th.chk { width: 34px; padding-right: 0; }
table.chats input[type='checkbox'] { width: 16px; height: 16px; accent-color: var(--navy); }
.th-sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; font-weight: 600; }
.th-sort:hover { color: var(--text); }
.c-name { min-width: 220px; }
.c-name .sub, .c-last .sub, .c-bot .sub { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 3px; font-size: 12px; color: var(--faint); }
.c-name .ttl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.c-seg { white-space: nowrap; }
.c-seg .tag + .tag { margin-left: 5px; }
.c-staff, .c-last { white-space: nowrap; font-size: 13.5px; }
tr.row-over td:first-child { box-shadow: inset 3px 0 0 var(--st-crit); }

/* --- карточка чата --- */
.chat-card .ttl-line { margin-top: 2px; word-break: break-word; }
.chat-card .lead-controls { gap: 6px 8px; }
.chat-card .lead-side { width: 340px; }
.rtag { font-size: 10.5px; font-weight: 700; padding: 0 6px; border-radius: 8px; line-height: 16px; background: var(--line-2); color: var(--muted); white-space: nowrap; }
.rtag.r-client { background: var(--t-rust-bg); color: var(--t-rust); }
.rtag.r-coord { background: var(--t-blue-bg); color: var(--t-blue); }
.rtag.r-expert { background: var(--t-green-bg); color: var(--t-green); }
.rtag.r-attorney, .rtag.r-head { background: var(--t-violet-bg); color: var(--t-violet); }
.rtag.r-kpp { background: var(--t-amber-bg); color: var(--warn-text); }
.msg.botmsg .bubble { background: var(--bg); border-style: dashed; }
.bubble .kind { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); background: var(--line-2); border-radius: 6px; padding: 1px 7px; margin-bottom: 3px; }
.waitbar.over { background: var(--st-crit-bg); border-top-color: var(--crit-line); color: var(--st-crit); }
.hintbox { margin-top: 8px; padding: 10px; border-radius: 8px; background: var(--st-warn-bg); border: 1px solid var(--warn-line); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.hintbox .pform { width: 100%; }
.pauses { display: flex; flex-direction: column; gap: 8px; }
.pause { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; display: flex; flex-direction: column; gap: 6px; }
.pause.suggested { border-style: dashed; background: var(--tint-warn); border-color: var(--warn-line); }
.pause.past { opacity: 0.6; }
.pause-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag.p-suggested { background: var(--st-warn-bg); color: var(--warn-text); }
.tag.p-now { background: var(--green-bg); color: var(--green); }
.tag.p-future { background: var(--blue-bg); color: var(--blue); }
.quote { font-size: 12px; color: var(--muted); border-left: 2px solid var(--line); padding-left: 8px; font-style: italic; max-height: 54px; overflow: hidden; }
.pform { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--panel); }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cps { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cp-in { display: inline-flex; align-items: center; gap: 2px; }
/* Дата АПК, паузы или КТ на выходном или празднике (0.9.9.8) */
.offday { color: var(--orange); background: var(--orange-bg); border-bottom: 2px solid var(--orange); border-radius: 3px; padding: 0 3px; }
.input.off-in { border-color: var(--orange); box-shadow: 0 0 0 2px var(--orange-bg); }
.offday-note { display: flex; gap: 6px; align-items: flex-start; color: var(--warn-text); background: var(--orange-bg); border: 1px solid var(--orange-line); border-radius: 6px; padding: 5px 8px; }
.offday-note svg { flex: none; color: var(--orange); margin-top: 2px; }
.cp-in .input { width: 150px; }
.facts { display: grid; gap: 6px; font-size: 13.5px; }
.facts div { display: flex; justify-content: space-between; gap: 10px; }
.facts span { color: var(--muted); }
.facts b { font-weight: 600; text-align: right; }
.facts.wide { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px 24px; }
.people { display: flex; flex-direction: column; gap: 5px; }
.person { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.person .p-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.events { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.lead-side h4 .btn { vertical-align: -6px; margin-left: 2px; }

/* --- сотрудники --- */
.hours-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.hours-grid .input { padding: 0 6px; text-align: center; }
.staff-tbl td { vertical-align: middle; }
.chip .badge.amber { margin-left: 2px; }

/* --- бот --- */
.botcard { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--faint); border-radius: var(--radius); padding: 16px; margin-bottom: 22px; display: flex; flex-direction: column; gap: 12px; }
.botcard.on { border-left-color: var(--green); }
.botcard .big { font-size: 17px; }
.botcard > .row { gap: 12px; flex-wrap: wrap; }
.botstat { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 20px; border-top: 1px solid var(--line-2); padding-top: 12px; }
.botstat span { display: block; font-size: 12px; color: var(--muted); }
.botstat b { font-weight: 600; font-size: 13.5px; }
.phr { display: flex; flex-direction: column; gap: 6px; }
.phr-row { display: flex; gap: 6px; align-items: flex-start; }
.phr-row textarea.input { min-height: 54px; }
code { background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 0 4px; font-size: 12px; }
.savebar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 10px; background: var(--navy); color: var(--on-accent); border-radius: 12px; padding: 10px 12px 10px 16px; margin-bottom: 22px; box-shadow: var(--shadow); }
.savebar span { flex: 1; font-weight: 600; }
.savebar .btn.ghost { color: var(--on-accent); }
.savebar .btn.ghost:hover { background: rgba(255, 255, 255, 0.12); }
.savebar .btn.primary { background: var(--on-accent); color: var(--navy); border-color: var(--on-accent); }
table.journal td { vertical-align: top; }
.jmsg { max-width: 420px; }

@media (max-width: 1100px) {
  .chat-card .lead-side.show { width: auto; }
}
@media (max-width: 860px) {
  .dash .grid2 .card { height: auto; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tile-v { font-size: 26px; }
  .filterbar select.input { flex: 1; min-width: 0; }
  .list.flat .lrow { flex-wrap: wrap; }
  .meter-wrap { width: 100%; flex: 1 1 100%; }
  .filters-toggle { display: inline-flex !important; }
  .chats-tools .filters { display: none; }
  .chats-tools .filters.show { display: flex; }
  .chats-tools { padding: 10px 12px; }
  .chats-tools .filters select.input { flex: 1 1 44%; max-width: none; }
  .chips.tabs { margin: 0 -12px; padding: 0 12px; }
  table.chats thead { display: none; }
  table.chats, table.chats tbody { display: block; }
  table.chats tr { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; padding: 12px; border-bottom: 1px solid var(--line-2); align-items: center; }
  table.chats td { display: block; padding: 0; border: 0; }
  table.chats td.chk { grid-row: 1 / span 2; }
  table.chats td.c-name { grid-column: 2; min-width: 0; font-size: 15px; }
  table.chats td.c-bot { grid-column: 3; grid-row: 1; justify-self: end; }
  table.chats td.c-seg { grid-column: 2 / span 2; }
  table.chats td.c-staff { grid-column: 2 / span 2; font-size: 13px; color: var(--muted); }
  table.chats td.c-staff::before { content: attr(data-l) ': '; }
  table.chats td.c-last { grid-column: 2; font-size: 13px; color: var(--muted); }
  table.chats td.c-last .sub { display: inline; margin-left: 6px; }
  table.chats td.c-wait { grid-column: 3; justify-self: end; }
  table.chats tr.click:hover td { background: transparent; }
  .c-name .ttl { max-width: 60vw; }
  .hours-grid { grid-template-columns: repeat(4, 1fr); }
  .staff-load .barcell { display: none; }
  .savebar { bottom: calc(66px + env(safe-area-inset-bottom)); }
  .form-2 { grid-template-columns: 1fr; }
  .cp-in .input { width: 100%; }
  .jmsg { max-width: none; }
}

/* ======================================================================
   Шаблоны, отправка из CRM, режимы бота, отчет режима проверки, интеграции
   ====================================================================== */
.rtag.r-via { background: var(--t-teal-bg); color: var(--t-teal); }
.rtag.r-bot { background: var(--line-2); color: var(--muted); }
.tag.test-chat { background: var(--t-pink-bg); color: var(--t-pink); }

/* --- ответ клиенту по шаблону в карточке чата --- */
.composer.tpl { display: flex; flex-direction: column; gap: 8px; }
.composer.tpl .pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.composer.tpl .pick select.input { flex: 1; min-width: 200px; }
.composer.tpl .pick .chips { flex: none; }
.composer.tpl textarea.input { min-height: 64px; max-height: 34vh; }
.composer.tpl .part-l { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: -4px; }
.composer-open .via-note { display: inline-flex; align-items: center; gap: 4px; }
.composer.tpl .from { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex: 1; min-width: 180px; }
.composer.tpl .miss { font-size: 12.5px; color: var(--warn-text); background: var(--st-warn-bg); border-radius: 8px; padding: 6px 10px; display: flex; gap: 6px; align-items: flex-start; }
.composer.tpl .miss svg { margin-top: 2px; }
.composer.tpl .stop { font-size: 12.5px; color: var(--st-crit); background: var(--st-crit-bg); border-radius: 8px; padding: 6px 10px; display: flex; gap: 6px; align-items: flex-start; }
.composer-open { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.outq { display: flex; flex-direction: column; gap: 4px; }
.outq-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 5px 10px; border-radius: 8px; background: var(--bg); }
.outq-row .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.outq-row.bad { background: var(--st-crit-bg); color: var(--st-crit); }
.outq-row.unk { background: var(--st-warn-bg); color: var(--warn-text); }
.outq-row.bad .t, .outq-row.unk .t { white-space: normal; }
.spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-3); border-top-color: var(--navy); animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

/* --- раздел "Шаблоны" --- */
.tpl-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.tpl-tools .search { max-width: 280px; }
.tpl-note { display: flex; gap: 8px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 14px; font-size: 13px; }
.tpl-note svg { margin-top: 2px; color: var(--muted); }
.tpl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; }
.tpl { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tpl.off { opacity: 0.6; border-style: dashed; }
.tpl-h { display: flex; align-items: flex-start; gap: 6px; }
.tpl-h b { flex: 1; min-width: 0; font-size: 14px; }
.tpl-h .btn { flex: none; margin: -3px -4px 0 0; }
.tpl-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tpl-body { white-space: pre-wrap; word-break: break-word; font-size: 13px; color: var(--text); background: var(--bg); border-radius: 8px; padding: 8px 10px; max-height: 148px; overflow: hidden; position: relative; }
.tpl-body.open { max-height: none; }
.tpl-body .ph { background: var(--t-blue-bg); color: var(--t-blue); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.tpl-body .blank { background: var(--st-warn-bg); color: var(--warn-text); border-radius: 4px; padding: 0 3px; font-weight: 700; }
.tpl-body .cut { display: block; text-align: center; color: var(--faint); font-size: 11.5px; margin: 6px 0; letter-spacing: 0.04em; }
.tpl-more { align-self: flex-start; border: 0; background: none; padding: 0; color: var(--blue); font-size: 12.5px; }
.tpl-edit { grid-column: 1 / -1; background: var(--panel); border: 1px solid var(--blue); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 0 0 3px var(--ring); }
.tpl-edit textarea.input { min-height: 190px; font-size: 13.5px; }
.tpl-edit .vars { display: flex; flex-wrap: wrap; gap: 5px; }
.tpl-edit .vars button { border: 1px solid var(--blue-line); background: var(--blue-bg); color: var(--t-blue); border-radius: 6px; padding: 1px 7px; font-size: 12px; font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.tpl-edit .vars button:hover { background: var(--t-blue-bg); }
.tpl-edit .vars button.blank { border-color: var(--warn-line); background: var(--st-warn-bg); color: var(--warn-text); }
/* --- банк шаблонов координаторов (0.9.9.2) --- */
.tag.teal-t { background: var(--t-teal-bg); color: var(--t-teal); }
.tpl-edit textarea.input.note { min-height: 0; font-size: 13px; }
.bank-copy .part-ins { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); background: var(--bg); border-radius: 8px; padding: 6px 10px; }
.bank-copy .part-ins span { flex: 1; min-width: 160px; }
.bank-copy { display: flex; flex-direction: column; gap: 8px; }
.bank-copy .pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bank-copy .pick select.input { flex: 1; min-width: 200px; }
.bank-copy .part-l { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 600; }
.bank-copy .bank-parts { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; padding-right: 2px; }
.bank-copy .bank-parts > * { flex: none; }
.soon-btn { opacity: 0.8; }
.soon-btn .tag.soon { margin-left: 4px; font-size: 10.5px; padding: 0 6px; }
.btn.primary.soon-btn { opacity: 0.75; }
.from .tag.soon { margin-left: 6px; }
.soon-link { margin-left: 8px; display: inline-flex; align-items: center; gap: 4px; }
.soon-link .tag.soon { font-size: 10.5px; padding: 0 6px; }
.bank-copy .part-l { flex-wrap: nowrap; }
.bank-copy .part-l .lbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bank-copy .part-l .btn { flex: none; }
@media (max-width: 520px) { .bank-copy .part-l .soon-btn .t, .bank-copy .wide-only { display: none; } }
.bank-copy .bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ro-bar .btn { flex: none; }
.kb-bank { flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.kb-bank > span { flex: 1; min-width: 220px; }
.kb-bank svg { color: var(--muted); flex: none; }
/* --- шаблоны: три колонки - разделы, список, шаблон (0.9.9.2) --- */
.page.tpx-page { max-width: 1480px; width: 100%; box-sizing: border-box; display: flex; flex-direction: column; min-height: 0; flex: 1; padding: 14px 20px 16px; }
.tpx-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.tpx-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: none; }
.tpx-tabs { align-items: center; }
.tpx-tabs .chip { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.tpx { flex: 1; min-height: 0; display: grid; grid-template-columns: 220px minmax(260px, 340px) minmax(0, 1fr); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--card-shadow); overflow: hidden; }
.tpx-nav { border-right: 1px solid var(--line); overflow-y: auto; padding: 8px 6px; display: flex; flex-direction: column; gap: 1px; background: var(--panel-2); min-height: 0; }
.tpx-sec { display: flex; align-items: center; gap: 8px; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 7px; font-size: 13px; color: var(--text); width: 100%; flex: none; }
.tpx-sec > span:not(.n) { flex: 1; min-width: 0; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tpx-sec .n { font-size: 11.5px; color: var(--faint); flex: none; }
.tpx-sec:hover { background: var(--hover); }
.tpx-sec.on { background: var(--sel); font-weight: 600; box-shadow: inset 3px 0 0 var(--navy); }
.tpx-sec.smart svg { color: var(--muted); flex: none; }
.tpx-sep { height: 1px; background: var(--line); margin: 6px 8px; flex: none; }
.tpx-src { position: relative; display: inline-flex; align-items: center; gap: 4px; padding: 2px 2px 2px 10px; border: 1px solid var(--line); border-radius: var(--pill); background: var(--panel); }
.tpx-src > a { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; color: var(--text); font-weight: 600; }
.tpx-src .btn.sm { height: 28px; }
.tpx-src-err { color: var(--st-crit); }
.tpx-src-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: min(380px, calc(100vw - 24px)); padding: 10px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-pop); }
.tpx-src-pop .input { height: 32px; font-size: 12.5px; }
.tpx-list { border-right: 1px solid var(--line); overflow-y: auto; min-width: 0; min-height: 0; }
.tpx-lh { position: sticky; top: 0; z-index: 2; height: 42px; box-sizing: border-box; background: var(--panel); border-bottom: 1px solid var(--line); padding: 0 12px; display: flex; align-items: center; gap: 8px; }
.tpx-catsel { display: none; }
.tpx-count { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tpx-gh { position: sticky; top: 42px; z-index: 1; background: var(--panel-2); padding: 5px 12px; font-size: 11.5px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line-2); }
.tpx-item { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line-2); background: none; padding: 9px 12px 9px 10px; border-left: 3px solid transparent; color: var(--text); }
.tpx-item:hover { background: var(--hover); }
.tpx-item.on { background: var(--sel); border-left-color: var(--navy); }
.tpx-item.off { opacity: 0.6; }
.tpx-it { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.tpx-ip { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpx-im { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11.5px; color: var(--faint); }
.tpx-im:empty { display: none; }
.tpx-im .teal { color: var(--t-teal); }
.tpx-im .lost { color: var(--red); }
.tpx-im .lng { color: var(--t-blue); font-weight: 700; }
.tpx-none { padding: 24px 16px; color: var(--muted); font-size: 13px; display: flex; flex-direction: column; gap: 8px; }
.tpx-pane { overflow-y: auto; min-width: 0; min-height: 0; }
.tpx-detail { padding: 16px 22px 26px; display: flex; flex-direction: column; gap: 12px; max-width: 880px; }
.tpx-dh { display: flex; align-items: flex-start; gap: 10px; }
.tpx-back { display: none; }
.tpx-dh.edit-h { display: none; align-items: center; }
.tpx-dt { flex: 1; min-width: 0; }
.tpx-cat { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.tpx-dt h2 { margin: 0; font-size: 18px; line-height: 1.3; font-family: var(--font-head); }
.tpx-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tpx-tags:empty { display: none; }
.tpx-note { display: flex; flex-direction: column; gap: 2px; background: var(--bg); border-radius: 8px; padding: 8px 12px; font-size: 13px; white-space: pre-wrap; }
.tpx-note b { font-size: 11.5px; color: var(--muted); }
.tpx-msgs { display: flex; flex-direction: column; gap: 10px; }
.tpx-msg { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.tpx-msg-h { display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 12px; background: var(--panel-2); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); }
.tpx-msg-h span { flex: 1; min-width: 0; }
.tpx-msg .tpl-body { background: none; border-radius: 0; padding: 10px 12px 12px; font-size: 13.5px; line-height: 1.55; max-height: none; }
.tpx-ins { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); background: var(--bg); border: 1px dashed var(--line-3); border-radius: 8px; padding: 7px 12px; }
.tpx-ins span { flex: 1; min-width: 160px; }
.tpx-ins svg { flex: none; }
.tpx-foot { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.tpx-foot > .small { display: flex; gap: 6px; align-items: flex-start; }
.tpx-foot > .small svg { margin-top: 2px; flex: none; }
.tpx-vars summary { cursor: pointer; color: var(--muted); }
.tpx-vars .vars-help { margin-top: 8px; }
.tpx-empty { height: 100%; min-height: 240px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--faint); font-size: 13px; }
.tpx-empty svg { width: 34px; height: 34px; opacity: 0.5; }
.tpx-pane .tpl-edit { border: 0; box-shadow: none; padding: 0; }
.tpx-pane .tpl-edit textarea.input { min-height: 260px; }
.tpx-pane .tpl-edit textarea.input.note { min-height: 0; font-size: 13px; }
@media (max-width: 1180px) {
  .tpx { grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); }
  .tpx-nav { display: none; }
  .tpx-lh { height: 50px; }
  .tpx-gh { top: 50px; }
  .tpx-catsel { display: block; flex: 1; min-width: 0; height: 34px; }
  .tpx-count { display: none; }
  .tpx-top .seg-tabs .chip .n, .tpx-tabs .chip svg { display: none; }
}
@media (max-width: 720px) {
  .page.tpx-page { padding: 10px 10px 8px; }
  .tpx-wrap { gap: 8px; }
  .tpx { grid-template-columns: minmax(0, 1fr); }
  .tpx-list { border-right: 0; }
  .tpx.show-detail .tpx-list { display: none; }
  .tpx:not(.show-detail) .tpx-pane { display: none; }
  .tpx-back { display: inline-flex; flex: none; }
  .tpx-dh.edit-h { display: flex; }
  .tpx-detail { padding: 10px 12px 20px; }
  .tpx-dt h2 { font-size: 17px; }
  .tpx-tabs { width: 100%; }
  .tpx-tabs .chip { flex: 1; justify-content: center; padding: 0 8px; }
  .tpx-tabs .chip .n, .tpx-tabs .chip svg { display: none; }
  .tpx-top .spacer { display: none; }
  .tpx-top .tpx-add .t, .tpx-src .t, .tpx-tabs .hint { display: none; }
  .tpx-top .tpx-add { margin-left: auto; }
  .tpx-wrap.detail .tpx-top { display: none; }
}
.vars-help { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 4px 18px; font-size: 12.5px; }
.vars-help div { display: flex; gap: 8px; align-items: baseline; }
.vars-help code { flex: none; }

/* --- бот: режимы --- */
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mode { text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mode:hover:not(:disabled):not(.on) { border-color: var(--line-3); background: var(--hover); }
.mode:disabled { cursor: default; }
.mode b { display: flex; align-items: center; gap: 7px; font-size: 14.5px; }
.mode span { font-size: 12.5px; color: var(--muted); }
.mode .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sw-off); flex: none; }
.mode.on { border-width: 2px; padding: 9px 11px; }
.mode.on.m-off { border-color: var(--faint); }
.mode.on.m-test { border-color: var(--st-warn); background: var(--tint-warn); }
.mode.on.m-test .dot { background: var(--st-warn); }
.mode.on.m-live { border-color: var(--green); background: var(--tint-ok); }
.mode.on.m-live .dot { background: var(--green); }
.botcard.m-test { border-left-color: var(--st-warn); }
.botcard.m-live { border-left-color: var(--green); }
.botwarn { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; background: var(--st-warn-bg); border: 1px solid var(--warn-line); border-radius: 8px; padding: 8px 10px; color: var(--warn-text); }
.botwarn svg { margin-top: 2px; flex: none; }
.sendrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* --- отчет режима проверки --- */
.report { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 22px; overflow: hidden; }
.report-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px 6px; }
.report-h h2 { margin: 0; font-size: 17px; font-weight: 700; }
.report-h .tag { font-size: 12px; }
.report-lead { padding: 0 16px 12px; font-size: 14.5px; line-height: 1.5; max-width: 860px; }
.report-lead b { font-weight: 700; }
.report .tiles { padding: 0 16px; margin-bottom: 6px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.report .tile { background: var(--bg); border-color: transparent; cursor: default; }
.report .tile:hover { box-shadow: none; border-color: transparent; }
.report .tile-s { white-space: normal; }
.report-sec { padding: 12px 16px 4px; border-top: 1px solid var(--line-2); margin-top: 10px; }
.report-sec h3 { margin: 0 0 8px; font-size: 14px; font-weight: 700; }
.report-sec h3 .card-sub { margin-left: 6px; }
.report .chart { padding: 0; }
.report .grid2 { gap: 0; }
.report .grid2 > .report-sec + .report-sec { border-left: 1px solid var(--line-2); }
.c-would { background: var(--s-blue); fill: var(--s-blue); }
.c-silent { background: var(--s-gray); fill: var(--s-gray); }
.speed { display: grid; gap: 10px; }
.speed-row { display: grid; grid-template-columns: 130px 1fr; gap: 10px; align-items: center; font-size: 13.5px; }
.speed-row .who { color: var(--muted); }
.speed-row .val { font-weight: 700; font-size: 16px; }
.speed-row .val small { font-weight: 400; font-size: 12.5px; color: var(--muted); margin-left: 6px; }
.report .bars { padding: 0; }
.bars .bar .fill.c-silent { background: var(--s-gray); }
.report .bar .track { height: 10px; }
.report .bars { gap: 9px; }
.report .bar { grid-template-columns: 1fr 36px; gap: 2px 10px; }
.report .bar .lbl { grid-column: 1 / -1; white-space: normal; }
.ex { display: flex; flex-direction: column; }
.ex-row { display: grid; grid-template-columns: 150px 1fr 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; align-items: start; }
.ex-row:last-child { border-bottom: 0; }
.ex-row .who { min-width: 0; }
.ex-row .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ex-row .q, .ex-row .a { border-radius: 10px; padding: 7px 10px; white-space: pre-wrap; word-break: break-word; max-height: 108px; overflow: hidden; }
.ex-row .q { background: var(--bg); border: 1px solid var(--line); }
.ex-row .a { background: var(--out); border: 1px dashed var(--blue-line); }
.ex-row .a.real { border-style: solid; }
.ex-head { font-size: 12px; color: var(--muted); font-weight: 600; padding-bottom: 2px; border-bottom: 1px solid var(--line); }
.report-foot { padding: 10px 16px 14px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line-2); margin-top: 10px; }
.report-empty { padding: 26px 16px 30px; color: var(--muted); max-width: 720px; }
.only-print { display: none; }

/* --- интеграции --- */
.integ { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.integ-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.integ-card.plan { border-style: dashed; background: var(--panel-2); }
.integ-h { display: flex; align-items: center; gap: 10px; }
.integ-h b { flex: 1; min-width: 0; font-size: 14.5px; }
.integ-logo { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--navy); color: var(--on-accent); font-weight: 800; font-size: 12px; flex: none; }
.integ-card.plan .integ-logo { background: var(--line-2); color: var(--muted); }
.integ-card p { margin: 0; font-size: 13px; color: var(--muted); }
.integ-card ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); display: grid; gap: 2px; }
.integ-card .state { font-size: 12.5px; }
.integ-card .btn { align-self: flex-start; margin-top: auto; }
.tag.plan { background: var(--violet-bg); color: var(--violet); }

@media (max-width: 860px) {
  .modes { grid-template-columns: 1fr; }
  .tpl-list { grid-template-columns: 1fr; }
  .tpl-tools .search { max-width: none; flex: 1 1 100%; }
  .report .grid2 > .report-sec + .report-sec { border-left: 0; }
  .ex-row { grid-template-columns: 1fr; gap: 6px; }
  .ex-head { display: none; }
  .speed-row { grid-template-columns: 1fr; gap: 2px; }
  .composer.tpl .pick .btn { order: 2; margin-left: auto; }
  .composer.tpl .pick select.input { order: 3; flex: 1 1 100%; }
}

/* --- печать отчета: на листе только отчет --- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; }
  .side, .topbar, .tabbar, .toast, .drawer, .drawer-back, .savebar, .no-print { display: none !important; }
  .app, .main, .view { display: block; height: auto; overflow: visible; }
  .main { padding: 0; }
  body.print-report .page > *:not(.report) { display: none !important; }
  .page { padding: 0; max-width: none; }
  .report { border: 0; margin: 0; }
  .report .tile { border: 1px solid var(--line); background: #fff; }
  .report-sec, .ex-row, .tile { break-inside: avoid; }
  .ex-row .q, .ex-row .a { max-height: none; }
  .only-print { display: block; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}


/* ---------- подсказка у знака вопроса ---------- */
.hint { display: inline-flex; vertical-align: middle; }
.hint-b { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 10.5px; font-weight: 700; line-height: 1; padding: 0; display: inline-grid; place-items: center; flex: none; cursor: pointer; user-select: none; }
.hint-b:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.hint-b:hover, .hint-b.on { border-color: var(--blue); color: var(--blue); }
.hint-pop { position: fixed; z-index: 120; background: var(--panel); border: 1px solid var(--line); border-radius: var(--ctl); box-shadow: var(--shadow-pop); padding: 10px 12px; font-size: 13px; font-weight: 400; line-height: 1.45; color: var(--text); text-align: left; white-space: normal; }
.hint-pop a { white-space: nowrap; font-weight: 600; }
.section-h .hint, .card-h .hint, .lead-side h4 .hint, label.field > span .hint { margin-left: 2px; }
.card-h { align-items: center; }
.card-h .more-l { margin-left: auto; }
@media (max-width: 860px) { .hint-b { width: 22px; height: 22px; font-size: 12px; } }

/* ---------- справка ---------- */
.page.help { max-width: 1000px; }
.help-tabs { align-items: center; margin-bottom: 16px; }
.help-tabs .badge { height: 16px; min-width: 16px; font-size: 10px; }
.help-cols { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 28px; align-items: start; }
.help-toc { position: sticky; top: 0; display: flex; flex-direction: column; gap: 1px; }
.help-toc a { padding: 6px 10px; border-radius: var(--ctl); color: var(--muted); text-decoration: none; font-size: 13.5px; }
.help-toc a:hover { background: var(--line-2); color: var(--text); }
.help-toc a.on { background: var(--line-2); color: var(--text); font-weight: 600; }
.help-body { max-width: 680px; }
.help-sec { padding: 0 0 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line-2); scroll-margin-top: 12px; }
.help-sec:last-child { border-bottom: 0; }
.help-sec h2 { margin: 0 0 12px; font-size: 18px; display: flex; align-items: baseline; gap: 10px; }
.help-date { font-size: 13px; font-weight: 400; color: var(--muted); }
.help-sec h3 { margin: 16px 0 4px; font-size: 14px; }
.help-sec p { margin: 0 0 6px; line-height: 1.55; }
.help-sec ul { margin: 0 0 6px; padding-left: 20px; line-height: 1.55; }
.help-sec li { margin-bottom: 2px; }
/* Гид по CRM: шаги, "Важно", пример, кнопки в тексте, поиск. */
.g-item { margin-top: 18px; }
.help-sec h2 + .g-item { margin-top: 4px; }
.help-sec .g-item h3 { margin: 0 0 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.g-tag { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--line-2); color: var(--muted); }
.g-steps { list-style: none; counter-reset: g; padding: 0; margin: 6px 0 8px; }
.g-steps li { counter-increment: g; position: relative; padding: 1px 0 10px 34px; line-height: 1.55; }
.g-steps li::before { content: counter(g); position: absolute; left: 0; top: 0; width: 23px; height: 23px; border-radius: 50%; background: var(--navy); color: var(--on-accent); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.g-steps li:not(:last-child)::after { content: ''; position: absolute; left: 11px; top: 27px; bottom: 2px; width: 1px; background: var(--line); }
.g-note { margin: 8px 0 10px; padding: 9px 12px; border-left: 3px solid var(--st-warn); border-radius: 0 8px 8px 0; background: var(--st-warn-bg); line-height: 1.55; }
.g-ex { margin: 8px 0 10px; padding: 9px 12px; border-radius: 8px; background: var(--line-2); line-height: 1.55; }
.g-ex-l { display: block; font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.g-btn { display: inline-block; padding: 0 7px; margin: 1px 0; border: 1px solid var(--line-3); border-radius: 6px; background: var(--panel); box-shadow: 0 1px 0 var(--line); font-size: 0.9em; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.g-q { display: inline-grid; place-items: center; width: 16px; height: 16px; border: 1px solid var(--line-3); border-radius: 50%; font-size: 10px; font-weight: 700; color: var(--muted); vertical-align: 1px; }
.g-go { margin-top: 10px; }
.g-go .btn .ic { margin-left: 2px; }
.g-find { position: relative; display: block; margin-bottom: 8px; }
.g-find .ic { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.g-find input { width: 100%; padding-left: 28px; }
.g-empty { color: var(--muted); }
@media (max-width: 860px) {
  .help-cols { grid-template-columns: 1fr; gap: 14px; }
  .help-toc { position: sticky; top: 0; z-index: 2; flex-direction: row; overflow-x: auto; gap: 6px; padding: 6px 0; background: var(--bg); scrollbar-width: none; }
  .help-toc a { white-space: nowrap; border: 1px solid var(--line); background: var(--panel); }
  .help-toc { align-items: center; }
  .help-sec { scroll-margin-top: 64px; }
  .g-find { flex: 0 0 170px; margin: 0; }
  .g-steps li { padding-left: 30px; }
}

/* ---------- вкладка "Вне CRM" и связанные чаты ---------- */
.filters.off { display: none !important; }
.chips.tabs .chip .badge { height: 17px; min-width: 17px; font-size: 10.5px; }
.outside { padding: 14px 20px 40px; max-width: 900px; }
.outside-h { margin-bottom: 12px; }
.related { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.rel { display: flex; flex-direction: column; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--ctl); text-decoration: none; color: var(--text); background: var(--panel); }
.rel:hover { border-color: var(--blue); text-decoration: none; }
.rel-t { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 860px) { .outside { padding: 12px 12px 40px; } }


/* Заголовки и крупные числа: у части оформлений свой шрифт. */
.brand-name, .lead-title h2, .tile-v, .kpi .v, .report-h h2, .help-sec h2, .login-card h1, .rv-row b, .speed-row .val { font-family: var(--font-head); }

/* ---------- вход: ссылка на почту, кнопка Google ---------- */
a.btn, a.btn:hover { text-decoration: none; }
.btn.wide { width: 100%; }
.login-card .linkbtn { display: block; border: 0; background: none; padding: 0; color: var(--blue); font-size: 13px; text-align: left; }
.login-card .linkbtn:hover { text-decoration: underline; }
.or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
/* Вход | Регистрация */
.login-tabs { display: flex; gap: 3px; padding: 3px; margin: 0 0 16px; background: var(--line-2); border-radius: var(--ctl); }
.login-tabs a { flex: 1; text-align: center; padding: 7px 8px; border-radius: max(2px, calc(var(--ctl) - 2px)); color: var(--muted); font-weight: 600; text-decoration: none; }
.login-tabs a:hover { color: var(--text); text-decoration: none; }
.login-tabs a.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); }
.login-tabs a:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.login-card h1 + .login-tabs { margin-top: -4px; }
.invite-who .muted { word-break: normal; }
/* Почты списком: строка = галочка, человек и почта, уровень доступа. На телефоне уровень уходит на вторую строку. */
.bulk-row { align-items: flex-start; }
.bulk-row > input[type='checkbox'] { width: 17px; height: 17px; margin-top: 3px; flex: none; accent-color: var(--navy); }
.bulk-row .main-c .s { white-space: normal; overflow-wrap: anywhere; }
.bulk-sel { width: auto; max-width: 240px; flex: none; }
@media (max-width: 860px) { .bulk-sel { flex: 1 1 100%; max-width: none; margin-left: 27px; } }
/* Длинная почта переносится, а не раздвигает карточку на телефоне. */
.login-card p, .modal p { overflow-wrap: anywhere; }
.linkbox .row > b { min-width: 0; flex: 0 1 auto; overflow-wrap: anywhere; }

/* ---------- фокус с клавиатуры: одинаково заметен в любом оформлении ---------- */
.btn:focus-visible, .chip:focus-visible, .nav a:focus-visible, .tabbar a:focus-visible, .theme-opt:focus-visible, .linkbtn:focus-visible, a.lrow:focus-visible, .th-sort:focus-visible, .mode:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.side .nav a:focus-visible { outline-color: var(--side-fg); outline-offset: -2px; }
/* Подсказка всегда обычным шрифтом, даже внутри заголовка с засечками. */
.hint-pop { font-family: var(--font); }

/* ---------- строка о программе: название и автор ---------- */
.credit { margin: 0; font-size: 11px; line-height: 1.4; letter-spacing: 0.01em; color: var(--muted); }
.credit a { color: inherit; text-decoration: none; }
.credit a:hover { text-decoration: underline; }
/* Страница входа: карточка по центру, строка под ней у нижнего края. */
.login { grid-template-rows: 1fr auto; row-gap: 14px; }
.login-credit { order: 2; text-align: center; color: var(--login-fg); }
.side-credit { padding: 8px 8px 0; color: var(--side-fg); opacity: var(--side-small); }
/* В узком меню - в две строки, без точки между ними. */
.side-credit span { display: block; }
.side-credit .sep { display: none; }
.more-credit { text-align: center; margin-top: 18px; }
.help-toc a:last-child { margin-top: 8px; }
/* Часы работы: смена из двух частей ("09-15, 18-21") должна быть видна целиком, поэтому дни идут в два ряда. */
.hours-grid { grid-template-columns: repeat(4, 1fr); }
.hours-grid .input { font-variant-numeric: tabular-nums; }

/* ---------- версия 0.6: стадии "Поданные", "RFE / NOID", "Архив"; этап; команды; поиск клиента ---------- */
/* Цвета стадий идут в порядке пути кейса и проверены как набор: соседние в полосе различимы и при нарушениях
   цветового зрения. Архив и служебные чаты в полосу не входят, у них серый. */
:root { --s-green: #008300; --s-red: #e34948; }
.c-start { background: var(--s-green); }
.c-filed { background: var(--s-aqua); }
.c-rfe { background: var(--s-yellow); }
.c-kpp { background: var(--s-magenta); }
.c-done { background: var(--s-violet); }
.c-unsorted { background: var(--s-red); }
.c-archive { background: var(--s-gray); }
.tag.seg-start::before { background: var(--s-green); }
.tag.seg-filed::before { background: var(--s-aqua); }
.tag.seg-rfe::before { background: var(--s-yellow); }
.tag.seg-kpp::before { background: var(--s-magenta); }
.tag.seg-done::before { background: var(--s-violet); }
.tag.seg-unsorted::before { background: var(--s-red); }
.tag.seg-archive::before { background: var(--s-gray); }
/* Закрытые чаты под легендой: отделены от стадий и приглушены. */
.legend .lg.rest { color: var(--muted); }
/* Плитки: верхний ряд - работа сейчас, нижний - после подачи. */
@media (min-width: 900px) { .dash .tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.dash .grid2.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1180px) { .dash .grid2.grid3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) { .dash .grid2.grid3 { grid-template-columns: 1fr; } }
/* Этап активной работы, дата подачи, команда. */
.tag.phase { background: var(--line-2); color: var(--text); }
.c-seg .stage-d { margin-left: 6px; }
.lead-controls .stage-d { margin-left: -2px; }
.tag.team-t { background: none; border: 1px solid var(--line); color: var(--muted); font-weight: 500; }
.facts.stage-facts { margin-top: 10px; }
/* Поиск клиента в шапке дашборда: список найденного под строкой. */
.csearch-pop { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: min(560px, calc(100vw - 24px)); max-height: min(70vh, 460px); overflow: auto; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-pop); }
.csearch-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.csearch-row:hover, .csearch-row:focus-visible { background: var(--hover); outline: none; }
.csearch-row:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.csearch-row .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.csearch-row .who { flex: none; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.csearch-more { padding: 8px 10px 4px; }
.csearch-pop .pad { padding: 10px; }
.csearch-pop.stale .csearch-row { opacity: .55; }
@media (max-width: 720px) { .csearch-row .who { display: none; } .csearch-pop { position: fixed; left: 12px; right: 12px; top: 62px; width: auto; } }
/* Кнопка "Наверх". На телефоне - над нижней панелью. */
.totop { position: fixed; z-index: 30; right: 22px; bottom: 22px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-3);
  background: var(--panel); color: var(--text); box-shadow: var(--shadow-pop); cursor: pointer; }
.totop:hover { background: var(--hover); }
.totop:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 860px) { .totop { right: 14px; bottom: calc(74px + env(safe-area-inset-bottom, 0px)); } }
@media print { .totop { display: none; } }

/* ---------- версия 0.7 ---------- */
/* Логотип в меню - ссылка на дашборд. */
a.brand { color: inherit; text-decoration: none; border-radius: 8px; }
a.brand:hover .brand-name { opacity: .85; }
a.brand:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Под именем в меню теперь две кнопки: "Смотреть как" и "Выйти". */
.side-foot button { display: flex; align-items: center; gap: 6px; font: inherit; cursor: pointer; }
.side-foot button + button { margin-top: 7px; }
/* Пометка "только администратор" и "в разработке". */
.tag.adm { gap: 4px; background: var(--violet-bg); color: var(--violet); font-weight: 600; }
.tag.adm .ic { width: 11px; height: 11px; }
.tag.soon { background: var(--orange-bg); color: var(--orange); font-weight: 600; }
/* Полоса режима "Смотреть как": всегда над шапкой, пока режим включен. */
.viewbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 20px; background: var(--violet-bg); color: var(--violet); border-bottom: 1px solid var(--line); font-size: 13.5px; }
.viewbar span { color: var(--text); }
.viewbar .ic { flex: none; }
.modal.viewas { width: min(440px, calc(100vw - 24px)); top: 12vh; max-height: 80vh; overflow: auto; }
.viewas-opt { display: block; width: 100%; margin: 0 0 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); font: inherit; text-align: left; }
button.viewas-opt { cursor: pointer; }
button.viewas-opt:hover { background: var(--hover); }
.viewas-opt.on { border-color: var(--violet); box-shadow: inset 0 0 0 1px var(--violet); }
.viewas-opt b { display: block; }
.viewas-opt small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.viewas-opt .row { margin-top: 8px; }
.viewas-opt select { flex: 1; min-width: 0; }
/* Сотрудники: поиск, сворачиваемые блоки, график по дням недели. */
.staff-search { max-width: 280px; }
.fold { margin-bottom: 10px; overflow: hidden; }
.fold-h { display: flex; align-items: center; gap: 8px; width: 100%; padding: 11px 14px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.fold-h:hover { background: var(--hover); }
.fold-h:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--focus); }
.fold-h > .ic:first-child { flex: none; color: var(--muted); transition: transform .15s; }
.fold.open > .fold-h > .ic:first-child { transform: rotate(90deg); }
.fold-h b { font-size: 14.5px; }
.fold-h .n { font-size: 12px; color: var(--muted); }
.fold-h .tag.adm { margin-left: auto; }
.fold-b { overflow: auto; border-top: 1px solid var(--line); }
.fold-b .tbl th { position: static; }
/* Столбцы одной ширины во всех блоках: таблицы стоят друг под другом и читаются как одна. */
.fold-b .staff-tbl { table-layout: fixed; width: 100%; min-width: 560px; }
.fold-b .staff-tbl th.c-user { width: 21%; }
.fold-b .staff-tbl th.c-role { width: 13%; }
.fold-b .staff-tbl th.c-team { width: 9%; }
.fold-b .staff-tbl th.c-hours { width: 17%; }
.fold-b .staff-tbl th.c-load { width: 8%; }
.fold-b .staff-tbl th.c-seen { width: 9%; }
.fold-b .staff-tbl th.c-acc { width: 11%; }
.fold-b .staff-tbl td { overflow-wrap: break-word; }
.fold-b .hours-tbl th.c-role { width: 15%; }
.fold-b .hours-tbl th.day { width: 8.5%; }
@media (max-width: 720px) { .fold-b .staff-tbl { min-width: 0; } .fold-b .staff-tbl th.c-role { width: 31%; } .fold-b .staff-tbl th.c-load { width: 15%; } .fold-b .staff-tbl th.c-acc { width: 20%; }
  .fold-b .staff-tbl th, .fold-b .staff-tbl td { padding-left: 8px; padding-right: 6px; } .fold-b .staff-tbl th:first-child, .fold-b .staff-tbl td:first-child { padding-left: 12px; }
  .fold-b .hours-tbl { min-width: 560px; } .fold-b .hours-tbl th.day { width: 11%; } }
.hours-tbl th.day, .hours-tbl td.day { text-align: center; font-variant-numeric: tabular-nums; padding-left: 6px; padding-right: 6px; }
/* День из двух частей - двумя строками, чтобы не залезал на соседний день. */
.hours-tbl td.day div { white-space: nowrap; }
.hours-tbl td.day.off { color: var(--faint); }
.hours-tbl td:first-child { min-width: 170px; }
/* Пример календаря месяца (в разработке). */
.cal-month { margin-top: 16px; }
.cal-month .cal-wrap { margin-top: 10px; max-height: 70vh; }
.cal-err { color: var(--red); }
.cal-wrap { overflow: auto; }
.cal { border-collapse: separate; border-spacing: 2px; font-size: 12px; }
.cal th { font-weight: 600; color: var(--muted); text-align: center; padding: 2px 0; min-width: 28px; }
.cal th small { display: block; font-weight: 400; font-size: 10px; }
.cal td { width: 28px; height: 26px; text-align: center; border-radius: 5px; background: var(--panel-2); color: var(--muted); font-weight: 600; }
.cal td.who { width: auto; min-width: 110px; padding: 0 10px 0 0; text-align: left; background: none; color: var(--text); font-weight: 500; }
.cal td.vac, .cal-legend i.vac { background: var(--blue-bg); color: var(--blue); }
.cal td.sick, .cal-legend i.sick { background: var(--orange-bg); color: var(--orange); }
.cal td.off, .cal-legend i.off { background: var(--line-2); color: var(--faint); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
@media (max-width: 720px) { .staff-search { max-width: none; order: 5; flex-basis: 100%; } .viewbar { padding: 8px 12px; } }
/* Карточка чата и затемнение открываются под полосой режима, а не поверх нее. */
.drawer, .drawer-back { top: var(--viewbar-h, 0px); }
@media print { .viewbar { display: none; } }


/* 0.8. Раздел "Таблицы": встроенная Google-таблица, выбор вкладки, архив. */
.tables-page { display: flex; flex-direction: column; }
.tbl-chips { margin-bottom: 10px; }
.tbl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.tbl-bar .tbl-tab { min-width: 220px; max-width: 360px; width: auto; }
.tbl-bar .spacer { flex: 1; }
.sheet-frame { display: block; width: 100%; height: calc(100vh - 210px); min-height: 440px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
@supports (height: 100dvh) { .sheet-frame { height: calc(100dvh - 210px); } }
.tbl-note { margin-top: 8px; }
.tbl-manage { margin-bottom: 12px; }
.tbl-manage code.sa { user-select: all; overflow-wrap: anywhere; }
.tbl-list { display: flex; flex-direction: column; }
.tbl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tbl-row > .input:first-child { width: 250px; }
.tbl-row .grow, .tbl-add .grow { flex: 1; min-width: 220px; }
.tbl-row .check { white-space: nowrap; }
.tbl-add { margin-top: 12px; gap: 6px; }
.tbl-add > .input:first-child { width: 250px; }
@media (max-width: 720px) {
  .tbl-bar .tbl-tab { min-width: 0; flex: 1; max-width: none; }
  .sheet-frame { height: calc(100vh - 250px); min-height: 360px; }
  .tbl-row > .input:first-child, .tbl-add > .input:first-child { width: 100%; }
}
/* Карточка чата: записи о клиенте из таблиц. */
.tag.sheet-t { background: var(--t-teal-bg); color: var(--t-teal); }
.srec-g { margin-bottom: 8px; }
.srec-gh { font-size: 12.5px; margin-bottom: 4px; }
.srec-gh a { font-weight: 600; color: var(--text); text-decoration: none; }
.srec-gh a:hover { text-decoration: underline; }
.srec { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 4px; background: var(--panel); }
.srec > summary { list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 6px 9px; cursor: pointer; font-size: 12.5px; }
.srec > summary::-webkit-details-marker { display: none; }
.srec > summary:hover { background: var(--hover); border-radius: 8px; }
.srec > summary:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--focus); border-radius: 8px; }
.srec-d { font-variant-numeric: tabular-nums; color: var(--muted); }
.srec-k { display: inline-flex; align-items: center; gap: 3px; overflow-wrap: anywhere; }
.srec-k .ic { color: var(--green); }
.srec[open] > summary { border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; }
.srec-cells { display: grid; grid-template-columns: minmax(90px, 38%) 1fr; gap: 3px 10px; margin: 0; padding: 8px 9px; font-size: 12.5px; }
.srec-cells dt { color: var(--muted); overflow-wrap: anywhere; }
.srec-cells dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.srec > a { display: inline-flex; align-items: center; gap: 4px; margin: 0 9px 8px; }
.srec-arch { margin-top: 6px; }
.srec-arch > summary { cursor: pointer; font-size: 12.5px; color: var(--muted); padding: 4px 0; }
.srec-arch[open] > summary { margin-bottom: 6px; }
@media print { .sheet-frame, .tbl-bar, .tbl-note { display: none; } }
/* 0.8.1. Боковое меню, свернутое до значков (кнопка "Свернуть меню"). В оформлении с меню сверху его нет. */
.side { transition: width .15s ease; }
.side-gap { flex: 1; }
:root:not([data-theme='mono']) .app.side-mini .side { width: 64px; padding: 16px 8px; }
:root:not([data-theme='mono']) .app.side-mini .brand { justify-content: center; padding: 4px 0 18px; }
:root:not([data-theme='mono']) .app.side-mini .brand-name,
:root:not([data-theme='mono']) .app.side-mini .nav-t,
:root:not([data-theme='mono']) .app.side-mini .side-foot .who,
:root:not([data-theme='mono']) .app.side-mini .side-foot button span,
:root:not([data-theme='mono']) .app.side-mini .side-credit { display: none; }
:root:not([data-theme='mono']) .app.side-mini .nav a { position: relative; justify-content: center; padding: 10px 0; }
:root:not([data-theme='mono']) .app.side-mini .nav .badge { position: absolute; top: 1px; right: 1px; margin: 0; min-width: 18px; padding: 0 4px; font-size: 10px; line-height: 16px; }
:root:not([data-theme='mono']) .app.side-mini .nav .newdot { position: absolute; top: 6px; right: 9px; margin: 0; }
:root:not([data-theme='mono']) .app.side-mini .side-foot { padding: 10px 0 0; display: flex; flex-direction: column; align-items: center; gap: 12px; }
:root:not([data-theme='mono']) .app.side-mini .side-foot button + button { margin-top: 0; }
:root:not([data-theme='mono']) .app.side-mini .side-foot .ic { width: 18px; height: 18px; }
@media (min-width: 861px) { [data-theme='mono'] .side-toggle { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }
/* 0.8.3. Кнопка "свернуть меню" - кружок на правой грани меню, чуть ниже логотипа. */
.side { position: relative; }
.side-toggle { position: absolute; top: 62px; right: -12px; z-index: 6; width: 24px; height: 24px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel); color: var(--muted); display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18); }
.side-toggle:hover { color: var(--text); border-color: var(--line-3); }
.side-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.side-toggle .ic { width: 14px; height: 14px; }
[data-theme='vivid'] .side-toggle { top: 66px; }
@media (max-width: 860px) { .side-toggle { display: none; } }
/* 0.8.3. Таблицы: страница на всю высоту, своя полоса вкладок под таблицей, масштаб. */
.page.tables-page { max-width: none; height: 100%; box-sizing: border-box; display: flex; flex-direction: column; padding: 12px 16px 10px; }
.tables-page .tbl-bar { margin-bottom: 8px; flex-wrap: nowrap; }
.tables-page .tbl-bar > b { white-space: nowrap; }
/* Кнопки таблиц переносятся на вторую строку, а не уходят за край (раньше третья таблица пряталась). */
.tbl-bar .tbl-chips { flex: 0 1 auto; flex-wrap: wrap; min-width: 0; margin: 0; }
.tbl-bar .tbl-chips .chip { display: inline-block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl-bar .tbl-status { white-space: nowrap; }
/* 0.8.4. Поиск по таблице: поле в строке над таблицей, результаты - списком под ним. */
.tbl-search { position: relative; display: flex; align-items: center; flex: 0 1 240px; min-width: 150px; }
.tbl-search > .ic { position: absolute; left: 9px; color: var(--muted); pointer-events: none; }
.tbl-search .input { width: 100%; padding-left: 30px; }
.tbl-found { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; width: min(420px, 92vw); max-height: 60vh; overflow: auto; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.tbl-found button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px;
  background: none; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.tbl-found button.on { background: var(--hover); }
.tbl-found .f-n { font-weight: 600; overflow-wrap: anywhere; }
.tbl-found .f-w { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.tbl-found .f-h { grid-column: 1 / -1; font-size: 12px; overflow-wrap: anywhere; }
.tbl-found mark { background: var(--st-warn-bg); color: inherit; border-radius: 3px; padding: 0 1px; }
.tbl-found .f-none, .tbl-found .f-more { padding: 8px 10px; font-size: 12.5px; color: var(--muted); }
.srec-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 9px 8px; }
.srec-links a { display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 720px) { .tbl-search { flex: 1 1 100%; order: 5; } .tbl-found { left: 0; right: auto; width: 100%; } }
/* На телефоне кнопки таблиц - одной строкой с прокруткой пальцем: следующая видна краем. */
@media (max-width: 720px) { .tbl-bar .tbl-chips { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .tbl-bar .tbl-chips .chip { flex: none; max-width: 200px; } }
.tbl-zoom { display: inline-flex; align-items: center; flex: none; border: 1px solid var(--line); border-radius: var(--ctl); background: var(--panel); }
.tbl-zoom .btn { border: 0; background: none; box-shadow: none; }
.tbl-zoom .btn.icon { font-size: 16px; font-weight: 600; width: 28px; }
.tbl-zoom-v { min-width: 50px; font-variant-numeric: tabular-nums; justify-content: center; }
.tbl-frame { position: relative; flex: 1; min-height: 300px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; background: var(--panel); }
.tbl-frame .sheet-frame { position: absolute; top: 0; left: 0; min-height: 0; border: 0; border-radius: 0; transform-origin: 0 0; }
.tbl-tabs { display: flex; align-items: stretch; flex: none; min-height: 38px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); background: var(--panel-2); }
.tbl-tabs.arch { background: var(--gold-bg); }
.tbl-tabs-list { display: flex; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.tbl-tab-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border: 0; border-top: 2px solid transparent; background: none;
  font: inherit; font-size: 13px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.tbl-tab-btn:hover { background: var(--hover); color: var(--text); }
.tbl-tab-btn.on { background: var(--panel); color: var(--text); font-weight: 600; border-top-color: var(--navy); }
.tbl-tab-btn.hid { font-style: italic; }
.tbl-tab-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.tbl-mode { display: inline-flex; align-items: center; flex: none; padding: 0 8px; border-right: 1px solid var(--line); }
.tbl-mode button { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; }
.tbl-mode button + button { border-left: 0; }
.tbl-mode button:first-child { border-radius: 999px 0 0 999px; }
.tbl-mode button:last-child { border-radius: 0 999px 999px 0; }
.tbl-mode button.on { background: var(--navy); border-color: var(--navy); color: var(--on-accent); }
.tbl-mode button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.tbl-pop { position: relative; display: inline-flex; flex: none; }
.tbl-pop > .tbl-tab-btn { height: 100%; }
.tbl-tech { border-left: 1px solid var(--line); }
.tbl-pop-list { position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 30; min-width: 230px; max-height: 60vh; overflow: auto; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.tbl-tech .tbl-pop-list { left: auto; right: 0; }
.tbl-pop-list button { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px;
  background: none; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.tbl-pop-list button:hover { background: var(--hover); }
.tbl-pop-list button.on { background: var(--sel); font-weight: 600; }
.tbl-pop-h { padding: 8px 10px 4px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
@media (max-width: 720px) {
  .page.tables-page { padding: 8px 8px 6px; }
  .tables-page .tbl-bar { flex-wrap: wrap; }
  .tbl-zoom { display: none; }
  .tbl-mode button { padding: 3px 8px; }
}
/* 0.8.3. Сотрудники: "Кто еще пишет в чатах" - строка раскрывается, видно чаты и сообщения. */
.senders .sender { border-bottom: 1px solid var(--line); }
.senders .sender:last-child { border-bottom: 0; }
.senders .sender-h { display: flex; align-items: center; gap: 8px; padding: 0; border: 0; }
.senders .sender-open { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 9px 4px; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: 6px; }
.senders .sender-open:hover { background: var(--hover); }
.senders .sender-open:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.senders .sender.open .sender-open { background: var(--hover); }
.sender-card { padding: 4px 6px 14px 10px; border-left: 3px solid var(--line); margin: 2px 0 10px 4px; }
.sender-card h4 { margin: 12px 0 6px; font-size: 13px; }
.sender-chats { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow: auto; }
.sender-chat { display: flex; justify-content: space-between; gap: 10px; padding: 4px 6px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: 13px; }
.sender-chat:hover { background: var(--hover); }
.sender-chat .t { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sender-chat .small { flex: none; }
.sender-msgs { display: flex; flex-direction: column; gap: 6px; }
.sender-msg { padding: 6px 8px; border-radius: 8px; background: var(--panel-2); font-size: 13px; overflow-wrap: anywhere; white-space: pre-wrap; }
.sender-acts, .sender-new { gap: 6px; }
.sender-acts select { width: auto; max-width: 260px; }
.sender-new { margin-top: 8px; padding: 8px; border-radius: 8px; background: var(--panel-2); }
.sender-new .input { width: auto; }
/* 0.8.3. Идеи и ошибки. */
.ideas { max-width: 820px; }
.idea-form textarea { width: 100%; }
.idea-list .idea { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.idea-list .idea:last-child { border-bottom: 0; }
.idea-text { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.idea-reply { display: flex; gap: 8px; margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--panel-2); white-space: pre-wrap; }
.idea-reply .ic { flex: none; margin-top: 2px; color: var(--muted); }
.idea-answer { display: grid; grid-template-columns: 190px 1fr auto; gap: 8px; align-items: start; margin-top: 8px; }
@media (max-width: 720px) { .idea-answer { grid-template-columns: 1fr; } }
/* 0.8.3. Карточка чата: где документы клиента в отделе стратегии (Таблица проверки ОС). */
.rv-list { display: flex; flex-direction: column; gap: 4px; }
.rv-i { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.rv-i > summary, .rv-miss { list-style: none; display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; padding: 6px 9px; font-size: 12.5px; }
.rv-i > summary { cursor: pointer; }
.rv-i > summary::-webkit-details-marker { display: none; }
.rv-i > summary:hover { background: var(--hover); border-radius: 8px; }
.rv-i > summary:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--focus); border-radius: 8px; }
.rv-i[open] > summary { border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; }
.rv-i > a { display: inline-flex; align-items: center; gap: 4px; margin: 0 9px 8px; }
.rv-doc { font-weight: 600; overflow-wrap: anywhere; }
.rv-st { justify-self: start; white-space: normal; }
.rv-d { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rv-miss { border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); }
.tag.rv-os { background: var(--blue-bg); color: var(--blue); }
.tag.rv-rework { background: var(--st-warn-bg); color: var(--warn-text); }
.rv-list .srec-arch .rv-list { margin-top: 2px; }
@media (max-width: 420px) { .rv-i > summary, .rv-miss { grid-template-columns: minmax(0, 1fr) auto; } .rv-d { grid-column: 1 / -1; } }
/* 0.8.4. Отбор по нескольким сотрудникам (дашборд, список чатов). */
.sp { position: relative; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sp .chip .n { margin-left: 4px; }
.sp-sel .ic { margin-left: 2px; opacity: .6; }
.sp-join { border-style: dashed; }
.sp-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; width: min(560px, 92vw); padding: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.sp-pop > .input { width: 100%; margin-bottom: 8px; }
.sp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sp-col { max-height: 46vh; overflow: auto; }
.sp-h { position: sticky; top: 0; padding: 4px 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--panel); }
.sp-row { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.sp-row:hover { background: var(--hover); }
.sp-row input { flex: none; margin: 0; }
.sp-row span:first-of-type { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sp-empty { padding: 6px; }
.sp-join-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.sp-join-row .tbl-mode { padding: 0; border: 0; }
.sp-foot { margin-top: 10px; }
.staff-load tr.sel td { background: var(--sel); }
.staff-load tr.sel td.name { box-shadow: inset 3px 0 0 var(--navy); }
@media (max-width: 720px) { .sp-pop { position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: auto; border-radius: var(--radius) var(--radius) 0 0; max-height: 80vh; overflow: auto; } .sp-cols { grid-template-columns: 1fr; } .sp-col { max-height: none; } }
/* 0.8.4.1. Сроки проверки в ОС: в карточке, в списке чатов, на дашборде. */
.rv-due { grid-column: 2 / -1; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.rv-miss .rv-due { grid-column: auto; }
.rv-due.over { color: var(--red); font-weight: 600; }
.rv-i.over { box-shadow: inset 3px 0 0 var(--red); }
.rv-miss.over { border-color: var(--red); color: var(--text); }
.tag.doc-t { background: var(--t-teal-bg); color: var(--t-teal); }
.tag.doc-t.over, .tag.sheet-t.over { background: var(--red-bg); color: var(--red); }
.doc-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.dc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 4px 14px 10px; }
.dc-n { display: flex; flex-direction: column; gap: 2px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; }
.dc-n b { font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.dc-n span { font-size: 12px; color: var(--muted); }
.dc-n:hover { background: var(--hover); }
.dc-n.crit:not(.zero) b { color: var(--red); }
.dc-n.warn:not(.zero) b { color: var(--warn-text); }
.dc-n.zero b { color: var(--muted); }
.dc-list .lrow { align-items: center; }
.dc-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px; max-width: 55%; }
.week-tbl { width: 100%; }
.week-tbl td:first-child { text-align: left; }
.wk-d { white-space: nowrap; }
.wk-d.up, .wk-d.down { color: var(--muted); }
.wk-d .ic { vertical-align: -2px; }
.digest { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.digest-when.off { opacity: .55; }
.digest-when .input { width: auto; }
.digest-preview { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--panel-2); font: inherit; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; }
@media (max-width: 720px) { .dc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dc-tags { max-width: none; } }
/* 0.8.3. База знаний: инструкции отдела (в разработке) и гид по CRM. */
/* База знаний - в конце файла (раздел "База знаний: трек, документы, поиск"). */
/* 0.8.4.3. Таблицы команд: список "Команды" в полосе раздела, выбор команды в настройках, блок команды в карточке. */
.tbl-teams > .tbl-tab-btn { height: 28px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--pill); background: var(--chip-bg); font-weight: 500; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.tbl-teams > .tbl-tab-btn:hover { border-color: var(--line-3); }
.tbl-teams.on > .tbl-tab-btn { background: var(--navy); border-color: var(--navy); color: var(--on-accent); }
.tbl-teams .tbl-pop-list { top: calc(100% + 6px); bottom: auto; }
.tbl-team { width: auto; max-width: 150px; }
.team-open { font-weight: 500; display: inline-flex; align-items: center; gap: 3px; }
.team-b { display: flex; flex-direction: column; gap: 8px; }
.team-facts { font-size: 13px; }
.team-facts b { overflow-wrap: anywhere; }
.team-note { padding: 7px 9px; border-radius: 8px; background: var(--panel-2); overflow-wrap: anywhere; }
.team-links { display: flex; flex-wrap: wrap; gap: 4px; }
.team-line { display: flex; align-items: flex-start; gap: 6px; }
.team-line .ic { flex: none; margin-top: 2px; }
.team-line.over { color: var(--red); }
.team-line.warn { color: var(--warn-text); }
.team-line.ok .ic { color: var(--green); }
.team-sub { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 2px; }
.team-list { display: flex; flex-direction: column; gap: 4px; }
.team-task { display: flex; flex-direction: column; gap: 2px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); text-decoration: none; font-size: 12.5px; }
.team-task:hover { background: var(--hover); }
.team-task.over { border-color: var(--red); }
.team-task .over { color: var(--red); }
.team-task-t { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tag.sheet-t.bday, .tag.doc-t.bday { background: var(--green-bg); color: var(--green); }
.tag.doc-t.warn { background: var(--st-warn-bg); color: var(--warn-text); }
/* 0.8.4.5. Раздел "Таблицы": полоса (таблицы, поиск, масштаб) в шапке страницы, таблице - вся высота. */
.topbar.has-slot { position: relative; z-index: 20; padding-top: 8px; padding-bottom: 8px; }
.topbar.has-slot .grow { display: none; }
.top-slot { flex: 1; min-width: 0; display: flex; align-items: center; }
.top-slot .tbl-bar { flex: 1; min-width: 0; margin: 0; flex-wrap: nowrap; gap: 6px; }
.top-slot .tbl-bar .tbl-chips { flex: 1 1 auto; min-width: 80px; flex-wrap: nowrap; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, black calc(100% - 20px), transparent); mask-image: linear-gradient(to right, black calc(100% - 20px), transparent); padding-right: 20px; }
.top-slot .tbl-bar .tbl-chips::-webkit-scrollbar { display: none; }
.top-slot .tbl-bar .tbl-chips .chip { flex: none; max-width: 230px; }
.top-slot .tbl-bar .spacer { flex: 0 0 2px; }
/* Поиск свернут в значок и раскрывается по нажатию или Cmd+F; с текстом остается раскрытым. */
.top-slot .tbl-search { flex: none; min-width: 0; }
.top-slot .tbl-search .input { width: 34px; padding-right: 4px; cursor: pointer; transition: width .15s; }
.top-slot .tbl-search .input::placeholder { color: transparent; }
.top-slot .tbl-search:focus-within .input, .top-slot .tbl-search .input:not(:placeholder-shown) { width: 250px; padding-right: 8px; cursor: text; }
.top-slot .tbl-search:focus-within .input::placeholder { color: var(--faint); }
.tbl-status { display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 6px; color: var(--muted); cursor: default; }
.tbl-status.ok .ic { color: var(--green); }
.tbl-status:focus-visible { outline: 2px solid var(--focus); }
.page.tables-page { padding-top: 10px; }
@media (max-width: 720px) {
  .topbar.has-slot { flex-wrap: wrap; row-gap: 8px; }
  .top-slot { flex: 1 1 100%; order: 3; }
  .top-slot .tbl-bar { flex-wrap: wrap; row-gap: 8px; }
  .top-slot .tbl-bar .tbl-chips { flex: 1 1 100%; }
  .top-slot .tbl-bar > .hint { display: none; }
  .top-slot .tbl-search { flex: 1 1 120px; order: 0; }
  .top-slot .tbl-search .input, .top-slot .tbl-search:focus-within .input, .top-slot .tbl-search .input:not(:placeholder-shown) { width: 100%; cursor: text; }
  .top-slot .tbl-search .input::placeholder { color: var(--faint); }
  .page.tables-page { padding-top: 6px; }
}

/* 0.8.4.7. Задача координатора Start ("Клиента принял основной координатор") - плашка над полем ответа. */
.handbar { flex-wrap: wrap; row-gap: 6px; }
.handbar .waitbar-t { min-width: 220px; }
@media (max-width: 720px) {
  .handbar .waitbar-t { flex: 1 1 100%; }
}

/* 0.8.4.8. Колокольчик уведомлений в шапке: счетчик новых и окно со списком (новые и просмотренные). */
.bell { position: relative; flex: none; }
.bell-btn { position: relative; }
.bell-btn.on { background: var(--hover); }
.bell-n { position: absolute; top: -7px; right: -9px; height: 16px; min-width: 16px; padding: 0 4px; font-size: 10px; border: 2px solid var(--panel); box-sizing: content-box; }
.bell-panel:focus { outline: none; }
.bell-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: 380px; max-width: calc(100vw - 24px);
  display: flex; flex-direction: column; max-height: min(560px, calc(100vh - 90px));
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.bell-head { display: flex; align-items: center; gap: 4px; padding: 10px 8px 6px 14px; }
.bell-head .spacer { flex: 1; }
.bell-tabs { display: flex; gap: 6px; padding: 0 12px 10px; border-bottom: 1px solid var(--line); }
.bell-tabs .chip .n { margin-left: 4px; }
.bell-list { overflow: auto; padding: 6px; }
.bell-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 9px 8px; border-radius: 8px; color: var(--text); cursor: pointer; }
.bell-item:hover { background: var(--hover); }
.bell-item.new { background: var(--blue-bg); }
.bell-item.new:hover { background: var(--sel); }
.bell-item.new .bell-t { font-weight: 600; }
.bell-ic { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--chip-bg); color: var(--muted); }
.bell-ic.k-overdue, .bell-ic.k-bot_offline, .bell-ic.k-table_error, .bell-ic.k-kb_error { background: var(--red-bg); color: var(--red); }
.bell-ic.k-handover, .bell-ic.k-pause { background: var(--orange-bg); color: var(--orange); }
.bell-ic.k-assigned { background: var(--green-bg); color: var(--green); }
.bell-t { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.35; overflow-wrap: anywhere; }
.bell-t small { display: block; margin-top: 2px; color: var(--muted); font-weight: 400; font-size: 12px; }
.bell-empty { padding: 28px 12px; text-align: center; color: var(--muted); font-size: 13.5px; }
/* На планшете и телефоне подложка окна затемнена и стоит выше (z-index 59) - окно над ней. */
@media (max-width: 860px) {
  .bell-panel { z-index: 60; }
}
@media (max-width: 720px) {
  .bell-panel { position: fixed; top: calc(62px + var(--viewbar-h, 0px)); left: 8px; right: 8px; width: auto; max-width: none; max-height: calc(100vh - 140px - var(--viewbar-h, 0px)); }
}

/* 0.8.4.9. Статистика на дашборде: ответ клиентам, дни коммуникации, качество работы, сроки кейса, бот (администратору). */
.warn-t { color: var(--orange); }
.crit-t { color: var(--red); }
.rp-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 2px 14px 10px; }
.rp-nums > * { display: flex; flex-direction: column; gap: 2px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; min-width: 0; }
.rp-nums a:hover { background: var(--hover); }
.rp-nums b { font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.rp-nums span { font-size: 12px; color: var(--muted); }
.rp-weeks { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; padding: 4px 14px 14px; align-items: end; }
.rp-w { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.rp-v { font-size: 11px; font-variant-numeric: tabular-nums; color: var(--muted); }
.rp-track { position: relative; width: 100%; max-width: 30px; height: 70px; background: var(--chip-bg); border-radius: 4px 4px 2px 2px; overflow: hidden; }
.rp-fill { position: absolute; left: 0; right: 0; bottom: 0; background: var(--navy); border-radius: 4px 4px 0 0; }
.rp-l { font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.card > .pz-h { padding: 0 14px; }
.card > .list.flat { padding: 0 6px 8px; }
.seg-tabs { display: inline-flex; gap: 4px; flex: none; }
.card-h .spacer { flex: 1; }
.quality-tbl td.name { white-space: nowrap; }
.bars-l { display: flex; flex-direction: column; gap: 2px; padding: 0 14px 12px; }
.bars-l > div { display: flex; justify-content: space-between; gap: 10px; }
.bars-l span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-q { padding: 0 14px 10px; }
.dash .grid2.top { align-items: start; }
.dash .grid2.top .card { height: auto; }
.pz-more { padding: 0 14px 12px; }
.pz-stat { padding: 0 14px 6px; }
@media (max-width: 720px) {
  .rp-nums { grid-template-columns: 1fr 1fr; }
  .rp-weeks { gap: 3px; }
  .rp-l { font-size: 9.5px; }
}

/* Претензии в карточке клиента (реестр претензий). */
.claims { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.claim { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.claim.team { border-color: var(--red); }
.claim > summary { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 7px 9px; cursor: pointer; font-size: 12.5px; }
.claim > summary::-webkit-details-marker { display: none; }
.claim > summary:hover { background: var(--hover); border-radius: 8px; }
.claim > summary:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--focus); border-radius: 8px; }
.claim[open] > summary { border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; }
.claim-d { font-variant-numeric: tabular-nums; color: var(--muted); }
.tag.claim-k { background: var(--chip-bg); color: var(--text); }
.tag.claim-s.open { background: var(--orange-bg); color: var(--orange); }
.tag.claim-s.team { background: var(--red-bg); color: var(--red); }
.tag.claim-s.done { background: var(--green-bg); color: var(--green); }
.claim-t { padding: 8px 9px 0; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.claim-ok { display: flex; align-items: center; gap: 4px; padding: 0 9px 6px; }
.claim-ok .ic { color: var(--green); }
.bell-ic.k-claim { background: var(--red-bg); color: var(--red); }

/* 0.8.4.10. Скрытые вкладки таблиц: глаз в списке вкладок у администратора, скрытая вкладка в полосе - бледная. */
.tbl-pop-it { display: flex; align-items: center; gap: 2px; }
.tbl-pop-it > button:first-child { flex: 1; min-width: 0; }
.tbl-pop-list .tbl-eye { flex: none; width: auto; padding: 7px 8px; color: var(--muted); opacity: .6; }
.tbl-pop-it:hover .tbl-eye, .tbl-pop-list .tbl-eye:focus-visible { opacity: 1; }
.tbl-pop-list .tbl-eye:hover { color: var(--text); }
.tbl-pop-list .tbl-eye:disabled { opacity: .3; cursor: default; }
.tbl-pop-list .tbl-eye:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.tbl-tab-btn.off { color: var(--muted); }
.tbl-pop-list { width: max-content; max-width: min(440px, calc(100vw - 24px)); }
.tbl-pop-list .tag { flex: none; white-space: nowrap; }

/* 0.8.4.11. Скрины в идеях и ошибках: миниатюры в форме и в записях, просмотр на весь экран. */
.idea-foot { margin-top: 8px; gap: 8px; }
.idea-shots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.idea-shot { position: relative; display: block; flex: none; width: 120px; height: 80px; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel-2); cursor: zoom-in; }
span.idea-shot { cursor: default; }
.idea-shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.idea-shot-x { position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: var(--panel); color: var(--text); box-shadow: var(--shadow-pop); cursor: pointer; }
.idea-shot:focus-visible, .idea-shot-x:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.shot-view { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, 0.78); cursor: zoom-out; }
.shot-view:focus { outline: none; }
.shot-view img { max-width: 100%; max-height: calc(100vh - 48px); object-fit: contain; border-radius: 6px; background: var(--panel); }
.shot-close { position: absolute; top: 12px; right: 12px; }
@media (max-width: 720px) {
  .idea-shot { width: 96px; height: 64px; }
  .shot-view { padding: 12px; }
}

/* 0.8.4.12. Таблицы-отчеты списком: вкладки и цвета сверху, клиенты по цветам строк, режим совещания. */
.tbl-view { border-right: 0; padding: 0; }
.rp { flex: 1; min-height: 0; overflow: auto; padding: 0 2px 24px; }
.rp-dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18); }
.rp-dot.none { background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-3); }
.chip.on .rp-dot { box-shadow: 0 0 0 1.5px var(--on-accent); }
.rp-legend { display: flex; flex-direction: column; gap: 6px; padding: 4px 6px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.rp-legend .rp-dot { margin-right: 6px; vertical-align: -1px; }
.rp-legend b { color: var(--text); font-weight: 600; }
.rp-h { margin: 14px 2px 6px; font-size: 15px; }
.rp-sec { margin: 10px 2px 6px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: none; }
.rp-row { margin-bottom: 6px; border: 1px solid var(--line); border-left: 5px solid var(--rc, var(--line)); border-radius: 8px; background: var(--panel); }
.rp-row-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; width: 100%; padding: 8px 12px 4px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.rp-row-h:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 6px; }
.rp-row-h .ic:last-child { margin-left: auto; }
.rp-name { font-weight: 600; font-size: 14px; }
.tag.rp-tag { display: inline-flex; align-items: center; gap: 5px; background: var(--chip-bg); color: var(--text); }
.rp-people { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rp-kv { display: flex; flex-wrap: wrap; gap: 2px 16px; padding: 0 12px 6px; font-size: 12.5px; }
.rp-notes { padding: 0 12px 8px; font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.rp-notes.clamp > div { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rp-more { padding: 0 12px 8px; border-top: 1px dashed var(--line); }
.rp-more dl, .meet-rest { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; margin: 8px 0; font-size: 12.5px; }
.rp-more dt, .meet-rest dt { color: var(--muted); }
.rp-more dd, .meet-rest dd { margin: 0; overflow-wrap: anywhere; }
.rp-more .srec-links { margin: 4px 0 0; }

.meet { position: fixed; inset: 0; z-index: 95; display: flex; flex-direction: column; background: var(--bg); }
.meet:focus { outline: none; }
.meet-top { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--panel); }
.meet-t { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meet-n { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.meet-card { flex: 1; min-height: 0; overflow: auto; width: min(1100px, calc(100% - 32px)); margin: 18px auto; padding: 24px 28px; border: 1px solid var(--line); border-left: 10px solid var(--rc, var(--line)); border-radius: 14px; background: var(--panel); box-sizing: border-box; }
.meet-name { font-size: 30px; font-weight: 700; line-height: 1.2; }
.meet-about { margin-top: 4px; font-size: 16px; color: var(--muted); }
.meet-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.meet-tags .tag { font-size: 13px; }
.meet-legend { margin-top: 8px; color: var(--muted); font-size: 14px; }
.meet-people { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-top: 14px; font-size: 16px; }
.meet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 24px; margin-top: 18px; }
.meet-v { font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.meet-notes { display: grid; gap: 14px; margin-top: 18px; font-size: 16px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.meet-card .srec-links { margin: 16px 0 0; font-size: 14px; }
.meet-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px 18px; }

/* 0.8.4.13. Отчеты: кнопка "Проблема", отбор по эксперту, блок "Подача" в карточке клиента. */
.chip.rp-problem:not(.on) { border-color: var(--red); color: var(--red); }
.rp-card { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.rp-card .rp-row { margin-bottom: 0; }
.rp-row-h.static { cursor: default; padding-bottom: 2px; }
.rp-note { padding: 0 12px 4px; }
.rp-notes-d { padding: 0 12px 4px; }
.rp-notes-d > summary { cursor: pointer; color: var(--muted); margin-bottom: 4px; }
.rp-notes-d .rp-notes { padding: 0 0 4px; }
.rp-card .srec-links { margin: 2px 12px 8px; }

/* 0.8.4.13. История изменений строки клиента в отчетах (карточка, блок "Подача"). */
.rp-log { margin: 0 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.rp-log > summary { padding: 7px 10px; cursor: pointer; font-size: 12.5px; font-weight: 600; }
.rp-log > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 8px; }
.rp-log ul { list-style: none; margin: 0; padding: 0 10px 6px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.rp-log li { display: flex; flex-direction: column; gap: 1px; padding-top: 6px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.rp-log-d { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.rp-old { color: var(--muted); }
.rp-log .btn { margin: 0 10px 8px; }

/* 0.8.4.13. Полоса "CRM обновилась", кнопки групп таблиц со стрелкой. */
.updbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 20px; background: var(--blue-bg); color: var(--blue); border-bottom: 1px solid var(--blue-line); font-size: 13.5px; }
.tbl-teams > .tbl-tab-btn { display: inline-flex; align-items: center; gap: 6px; max-width: 320px; }
.tbl-pop-l { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl-pop-more { flex: none; opacity: .7; }
@media (max-width: 720px) { .updbar { padding: 8px 12px; } }

/* 0.8.4.13. Отчеты: отбор одной полосой поверх списка - в покое полупрозрачная, при наведении обычная. */
.rp-dock { position: sticky; top: 6px; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 10px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--panel) 72%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: var(--shadow-pop); opacity: .6; transition: opacity .15s ease, background-color .15s ease; }
.rp-dock:hover, .rp-dock:focus-within { opacity: 1; background: var(--panel); }
@media (hover: none) { .rp-dock { opacity: 1; background: var(--panel); } }
@media (prefers-reduced-motion: reduce) { .rp-dock { transition: none; } }
.rp-dock .chip { height: 26px; padding: 0 9px; font-size: 12.5px; }
.rp-dock .tbl-teams > .tbl-tab-btn { height: 26px; font-size: 12.5px; max-width: 240px; }
.rp-colors { display: flex; flex-wrap: wrap; gap: 4px; }
.rp-dock .rp-q { width: 170px; min-width: 0; height: 28px; }
.rp-dock .btn { flex: none; }
.rp-found { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rp-pop .tbl-pop-list { max-width: min(440px, calc(100vw - 24px)); }
.rp-pop .tbl-pop-list button > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-pop-r .tbl-pop-list { left: auto; right: 0; width: min(420px, calc(100vw - 24px)); }
.rp-pop-q { width: 100%; margin: 0 0 6px; box-sizing: border-box; }
.rp-pop-none { padding: 6px 10px; }
.chip.rp-filed-chip:not(.on) { border-style: dashed; }
.tag.rp-filed.warn { background: var(--orange-bg); color: var(--orange); }
.rp-filed-note { display: flex; align-items: flex-start; gap: 6px; padding: 0 12px 6px; }
.rp-filed-note .ic { flex: none; margin-top: 2px; }
.rp-filed-note.ok { color: var(--green); }
.rp-filed-note.warn { color: var(--warn-text); }
/* Метки из таблиц в шапке карточки чата - кнопки: ведут к блоку карточки, где об этом написано. */
.tag.tag-btn { border: 0; font-family: inherit; cursor: pointer; }
.tag.tag-btn:hover { filter: brightness(0.96); text-decoration: underline; text-underline-offset: 2px; }
.tag.tag-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
@keyframes rec-flash { from { background: var(--sel); box-shadow: 0 0 0 6px var(--sel); } to { background: transparent; box-shadow: 0 0 0 6px transparent; } }
.rec-flash { border-radius: 6px; animation: rec-flash 1.6s ease-out; }
@media (prefers-reduced-motion: reduce) { .rec-flash { animation: none; outline: 2px solid var(--focus); outline-offset: 2px; } }

/* 0.8.4.13. Полоса таблиц в шапке: при нехватке места сжимаются кнопки групп, у вида - только значки, колокольчик не наезжает. */
.top-slot .tbl-bar > * { flex-shrink: 0; }
.top-slot .tbl-bar > .tbl-chips { flex: 1 1 0; min-width: 80px; }
.top-slot .tbl-bar > .tbl-pop.tbl-teams { flex: 0 1 auto; min-width: 104px; }
.top-slot .tbl-bar > .tbl-pop.tbl-teams > .tbl-tab-btn { width: 100%; min-width: 0; max-width: 300px; }
.topbar.has-slot .bell { margin-left: 4px; }
@media (max-width: 1280px) {
  .top-slot .tbl-mode-t { display: none; }
  .top-slot .tbl-mode button { padding: 3px 8px; }
  .top-slot .tbl-bar > .hint { display: none; }
}
@media (max-width: 720px) { .top-slot .tbl-bar > .tbl-pop.tbl-teams > .tbl-tab-btn { max-width: none; } }

/* 0.8.4.13. Поданы ранее (свернуто в таблице), пометка прошлого месяца у раздела. */
.rp-pill.done { gap: 4px; background: var(--green-bg); color: var(--green); }
.rp-sh-old { margin-left: 6px; font-weight: 500; color: var(--warn-text); }
/* 0.8.4.13. Совещание по вкладке команды: "Проблемные / Обычные / Все", эксперты кнопками, клиенты по экспертам. */
.rp-dock .rp-seg { padding: 0; border: 0; }
.rp-dock .rp-seg button { height: 26px; padding: 0 10px; }
.rp-dock .rp-seg button .n { font-size: 11px; opacity: .75; }
.rp-ex { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; flex-basis: 100%; padding-top: 2px; }
.rp-ex .small { margin-right: 2px; }
.rp-gh.rp-gh-ex > th { font-size: 14px; }
.rp-gh.rp-gh-ex > th .ic { margin-right: 6px; vertical-align: -2px; color: var(--muted); }
.rp-sec-t { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.rp-sec-t.old { color: var(--warn-text); }

/* 0.8.4.13. Отчеты: месяц плана со стрелками, плитки статусов, клиенты таблицей с сортировкой; на телефоне - карточками. */
.rp-month { display: inline-flex; align-items: center; gap: 2px; }
.rp-month .btn.icon { width: 28px; height: 28px; }
.tag.rp-now { margin-left: 6px; padding: 0 6px; font-size: 10.5px; line-height: 16px; }
.rp-dock-r { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.chip.rp-st-chip { gap: 4px; }
.rp-old { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--warn-line); border-radius: 10px; background: var(--t-amber-bg); color: var(--warn-text); font-size: 13px; }
.rp-old .btn { margin-left: auto; }
.rp-sum { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 0 0 12px; }
.rp-tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; padding: 10px 12px 11px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); color: var(--text); font: inherit; text-align: left; cursor: pointer; overflow: hidden; transition: border-color .12s ease, background-color .12s ease; }
.rp-tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--rc, transparent); }
.rp-tile:hover { border-color: var(--line-3); }
.rp-tile.on { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); background: var(--sel); }
.rp-tile:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.rp-tile-l { display: flex; align-items: flex-start; gap: 6px; max-width: 100%; font-size: 12.5px; font-weight: 600; line-height: 1.3; color: var(--muted); }
.rp-tile-l .rp-dot, .rp-tile-l .ic { flex: none; margin-top: 2px; }
.rp-tile-n { display: flex; align-items: baseline; gap: 8px; font-size: 24px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.rp-tile-p { font-size: 13px; font-weight: 600; color: var(--green); }
.rp-tile.problem .rp-tile-l { color: var(--red); }
.rp-bar { display: block; width: 100%; height: 4px; margin-top: 6px; border-radius: 2px; background: var(--line-2); overflow: hidden; }
.rp-bar > span { display: block; height: 100%; border-radius: 2px; background: var(--green); }
@media (prefers-reduced-motion: reduce) { .rp-tile { transition: none; } }
.rp-else { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; }
/* position: relative - скрытая подпись колонки (.sr-only) прижата к таблице, а не к странице: иначе страница шире окна,
   и у кого полосы прокрутки видны (Windows), они появлялись и пропадали - "Итог" дрожал (04.11, Садкова). */
.rp-tw { position: relative; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow-x: auto; }
.rp-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.rp-table th, .rp-table td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: middle; }
.rp-table thead th { padding: 0; border-bottom: 1px solid var(--line); background: var(--panel-2); font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.rp-table thead th:first-child { border-top-left-radius: 12px; }
.rp-table thead th:last-child { border-top-right-radius: 12px; }
.rp-th { display: inline-flex; align-items: center; gap: 4px; width: 100%; padding: 9px 10px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.rp-th:hover, .rp-th.on { color: var(--text); }
.rp-th:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.rp-th-i { width: 1%; }
.rp-tr { cursor: pointer; }
.rp-tr:hover > td { background: var(--hover); }
.rp-tr.open > td { background: var(--sel); border-bottom-color: transparent; }
.rp-tr > td:first-child { box-shadow: inset 4px 0 0 var(--rc, transparent); }
.rp-td-name { min-width: 170px; }
.rp-td-name .tag { margin: 3px 0 0; }
.rp-name-btn { display: block; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.rp-name-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.rp-tr.done .rp-name-btn { font-weight: 500; color: var(--muted); }
.rp-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: var(--pill); background: color-mix(in srgb, var(--rc, var(--line-3)) 16%, var(--panel)); font-size: 12px; font-weight: 600; white-space: nowrap; }
.rp-pill.none { background: var(--line-2); color: var(--muted); }
/* Вид "Список" любой таблицы: ссылки кнопками, ближайшая КТ, просрочка, "показать еще" */
.rp-tile.over .rp-tile-l { color: var(--red); }
.rp-tile.over { --rc: var(--red); }
.rp-tile.warn { --rc: var(--warn-text); }
.rp-tile.rv-os { --rc: var(--blue); }
.rp-tile.rv-rework { --rc: var(--warn-text); }
.rp-tile.won { --rc: var(--green); }
.bd-table .rv-due { grid-column: auto; white-space: nowrap; }
.bd-table .tag.rv-st { white-space: nowrap; }
.bd-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.bd-links .btn { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-kt { white-space: nowrap; font-variant-numeric: tabular-nums; }
.bd-kt.soon { color: var(--warn-text); font-weight: 600; }
.bd-more { display: flex; justify-content: center; padding: 12px 0 4px; }
.rp-td-i .rp-notes-n + .rp-notes-n { margin-left: 6px; }
.tbl-aud { width: auto; max-width: 190px; }
.tbl-row .tbl-group { width: 170px; }
@media (max-width: 720px) { .tbl-row .tbl-group { width: auto; flex: 1 1 140px; } }
/* Каталог таблиц: одна кнопка в полосе раздела, в списке - папки по виду работы. */
.top-slot .tbl-bar > .tbl-pop.tbl-cat { flex: 0 1 auto; min-width: 140px; }
.top-slot .tbl-bar > .tbl-pop.tbl-cat > .tbl-tab-btn { max-width: 460px; font-weight: 600; }
.tbl-cat-f { font-weight: 500; color: var(--muted); margin-right: 6px; }
.tbl-cat-f::after { content: '/'; margin-left: 6px; color: var(--faint); }
.tbl-cat .tbl-pop-list { width: min(760px, calc(100vw - 24px)); max-width: none; max-height: min(72vh, 640px); padding: 8px; }
.tbl-cat-grid { columns: 3 220px; column-gap: 12px; }
.tbl-cat-sec { break-inside: avoid; padding-bottom: 6px; }
.tbl-cat-sec .tbl-pop-h { display: flex; align-items: center; gap: 6px; }
.tbl-cat-sec button { justify-content: flex-start; }
.tbl-cat-t { flex: 1; min-width: 0; overflow-wrap: anywhere; text-align: left; }
.tbl-cat-aud { display: inline-flex; flex: none; color: var(--faint); }
.rp-date { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-txt { display: inline-block; max-width: 240px; line-height: 1.35; }
.rp-td-p { max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-td-i { white-space: nowrap; text-align: right; color: var(--muted); }
.rp-notes-n { display: inline-flex; align-items: center; gap: 3px; margin-right: 6px; font-size: 12px; }
.rp-gh > th { padding: 14px 10px 6px; background: var(--panel-2); font-size: 13.5px; font-weight: 700; color: var(--text); }
.rp-sh > th { padding: 10px 10px 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.rp-detail > td { padding: 2px 14px 14px; background: var(--sel); }
.rp-dnotes { display: grid; gap: 10px; margin: 6px 0 10px; font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.rp-dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 16px; margin: 6px 0 8px; font-size: 12.5px; }
.rp-dl dt { color: var(--muted); }
.rp-dl dd { margin: 0; overflow-wrap: anywhere; }
.rp-detail .srec-links { margin: 4px 0 0; }
.rp-detail .rp-filed-note { padding: 6px 0 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (max-width: 720px) {
  .rp-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rp-tile-n { font-size: 20px; }
  .rp-dock-r { margin-left: 0; }
  .rp-dock .rp-q { flex: 1 1 100%; width: auto; order: 5; }
  .rp-tw { border: 0; background: none; overflow: visible; }
  .rp-table, .rp-table tbody { display: block; }
  .rp-table thead { display: none; }
  .rp-table .rp-tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin-bottom: 8px; padding: 10px 12px; border: 1px solid var(--line); border-left: 5px solid var(--rc, var(--line)); border-radius: 10px; background: var(--panel); }
  .rp-table .rp-tr > td, .rp-table .rp-tr:hover > td, .rp-table .rp-tr.open > td { display: block; padding: 0; border: 0; background: none; box-shadow: none; }
  .rp-table .rp-tr > td::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); }
  .rp-table .rp-tr > td.rp-td-name, .rp-table .rp-tr > td.rp-td-i { grid-column: 1 / -1; }
  .rp-table .rp-tr > td.rp-td-name::before, .rp-table .rp-tr > td.rp-td-i::before { content: none; }
  .rp-table .rp-tr > td.rp-td-i { text-align: left; }
  .rp-td-p { max-width: none; }
  .rp-table .rp-detail { display: block; margin: -10px 0 8px; }
  .rp-table .rp-detail > td { display: block; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; }
  .rp-table .rp-gh, .rp-table .rp-sh { display: block; }
  .rp-table .rp-gh > th, .rp-table .rp-sh > th { display: block; padding-left: 2px; background: none; }
}
@media (max-width: 720px) {
  .rp-dock { position: static; opacity: 1; background: var(--panel); box-shadow: none; }
  .rp-colors { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; margin: 0 -2px; padding: 0 2px 2px; }
  .rp-colors .chip { flex: none; }
  .meet-top { padding: 10px 12px; }
  .meet-card { margin: 10px auto; padding: 16px; width: calc(100% - 20px); border-left-width: 6px; }
  .meet-name { font-size: 22px; }
  .meet-v { font-size: 16px; }
  .meet-notes, .meet-people { font-size: 14px; }
  .meet-nav { padding: 10px 12px 14px; }
  .meet-nav .small { display: none; }
}

/* ======================================================================
   Оформление: пять вариантов (Настройки -> Оформление)
   navy  - Классика: синее меню слева (по умолчанию, правил ниже нет)
   dark  - Ночь: темная, плотная
   paper - Бумага: теплая, заголовки с засечками
   vivid - Яркая: цветное меню, крупные скругления
   mono  - Строгая: меню сверху, черно-белая, плотные таблицы
   ====================================================================== */

/* Шрифты лежат в public/fonts, лицензия там же. Браузер качает файл, только когда вариант включен. */
@font-face { font-family: 'PT Serif'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/pt-serif-cyrillic-400.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'PT Serif'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/pt-serif-latin-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'PT Serif'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/pt-serif-cyrillic-700.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'PT Serif'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/pt-serif-latin-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap; src: url('/fonts/manrope-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap; src: url('/fonts/manrope-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/plex-sans-cyrillic-400.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/plex-sans-latin-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/plex-sans-cyrillic-600.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/plex-sans-latin-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/plex-sans-cyrillic-700.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/plex-sans-latin-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- выбор в настройках ---------- */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.theme-opt { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); text-align: left; color: var(--text); }
.theme-opt:hover { border-color: var(--line-3); }
.theme-opt.on { border-color: var(--navy); box-shadow: 0 0 0 2px var(--ring); }
.theme-opt b { margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.theme-opt small { color: var(--muted); font-size: 12px; }
.theme-prev { position: relative; width: 100%; height: 92px; border-radius: 6px; overflow: hidden; background: var(--p-bg); border: 1px solid var(--p-edge, #d5dae0); display: block; }
.theme-prev i { position: absolute; display: block; font-style: normal; }
.tp-side { left: 0; top: 0; bottom: 0; width: 25%; background: var(--p-side); border-right: 1px solid var(--p-line); }
.tp-nav { left: 4%; top: 30%; width: 17%; height: 9%; border-radius: var(--p-r); background: var(--p-nav); }
.tp-card { left: 31%; right: 7%; top: 40%; height: 24%; background: var(--p-panel); border: 1px solid var(--p-line); border-radius: var(--p-r); }
.tp-card.b { top: 70%; right: 42%; height: 18%; }
.tp-btn { right: 7%; top: 71%; width: 26%; height: 16%; background: var(--p-accent); border-radius: var(--p-btn, var(--p-r)); }
.tp-aa { left: 31%; top: 9%; font: 700 15px/1.2 var(--p-font, var(--font)); color: var(--p-ink); letter-spacing: -0.01em; }
.t-navy { --p-bg: #f4f6f8; --p-panel: #fff; --p-side: #1d3045; --p-nav: rgba(255, 255, 255, 0.28); --p-line: #dce2e8; --p-accent: #1d3045; --p-ink: #1d3045; --p-r: 4px; }
.t-dark { --p-bg: #0d0f13; --p-panel: #15181e; --p-side: #0d0f13; --p-nav: #2a3040; --p-line: #2a303b; --p-accent: #8fa3ff; --p-ink: #e7e9ee; --p-r: 3px; --p-edge: #2a303b; }
.t-paper { --p-bg: #f4efe4; --p-panel: #fffdf8; --p-side: #ebe3d1; --p-nav: #fffdf8; --p-line: #d9cdb4; --p-accent: #1f5a48; --p-ink: #2a251e; --p-r: 1px; --p-font: 'PT Serif', Georgia, serif; --p-edge: #d9cdb4; }
.t-vivid { --p-bg: #f3f1fb; --p-panel: #fff; --p-side: linear-gradient(165deg, #6a4bff, #3a22b8); --p-nav: #fff; --p-line: transparent; --p-accent: #5a3df0; --p-ink: #1c1838; --p-r: 7px; --p-btn: 99px; --p-font: 'Manrope', sans-serif; --p-edge: #ddd6f5; }
.t-vivid .tp-side { left: 4%; top: 8%; bottom: 8%; width: 21%; border-radius: 7px; border: 0; }
.t-vivid .tp-nav { left: 6.5%; width: 16%; }
.t-vivid .tp-card { box-shadow: 0 3px 8px rgba(50, 30, 140, 0.12); }
.t-mono { --p-bg: #fff; --p-panel: #fff; --p-side: #111; --p-nav: #fff; --p-line: #bdbdbd; --p-accent: #111; --p-ink: #111; --p-r: 0px; --p-font: 'IBM Plex Sans', sans-serif; --p-edge: #bdbdbd; }
.t-mono .tp-side { right: 0; bottom: auto; width: auto; height: 17%; border-right: 0; }
.t-mono .tp-nav { left: 22%; top: 12%; width: 14%; height: 3%; }
.t-mono .tp-aa { left: 7%; top: 24%; }
.t-mono .tp-card { left: 7%; top: 50%; height: 20%; }
.t-mono .tp-card.b { top: 76%; height: 14%; }
.t-mono .tp-btn { top: 76%; height: 14%; }

/* ======================= Ночь ======================= */
:root[data-theme='dark'] {
  color-scheme: dark;
  --navy: #8fa3ff; --navy-2: #7d92f2; --navy-3: #a6b6ff; --on-accent: #0c0e13; --on-solid: #0c0e13;
  --bg: #0d0f13; --panel: #15181e; --panel-2: #191d24; --hover: #20252f; --sel: #1f2533;
  --btn-bg: var(--panel-2); --chip-bg: transparent; --input-bg: var(--bg);
  --line: #262b35; --line-2: #1e222b; --line-3: #3a4150;
  --text: #e7e9ee; --muted: #9aa3b2; --faint: #6c7686;
  --green: #4cc38a; --green-bg: rgba(76, 195, 138, 0.13); --green-line: rgba(76, 195, 138, 0.35);
  --gold: #e0a94a; --gold-bg: rgba(224, 169, 74, 0.13);
  --red: #f0716f; --red-bg: rgba(240, 113, 111, 0.13);
  --blue: #7fb0f5; --blue-bg: rgba(127, 176, 245, 0.13); --blue-line: rgba(127, 176, 245, 0.35);
  --violet: #b39cf0; --violet-bg: rgba(179, 156, 240, 0.15);
  --orange: #f0994d; --orange-bg: rgba(240, 153, 77, 0.13); --orange-line: rgba(240, 153, 77, 0.35);
  --note: #26220f; --note-line: #4a421f; --out: #1a2333; --out-line: #2b3a54;
  --warn-text: #f0c35a; --warn-line: rgba(250, 178, 25, 0.35); --crit-line: rgba(236, 106, 104, 0.4);
  --tint-warn: rgba(250, 178, 25, 0.07); --tint-ok: rgba(76, 195, 138, 0.07);
  --sw-off: #3a4150; --ring: rgba(143, 163, 255, 0.28); --overlay: rgba(0, 0, 0, 0.62); --hoverband: rgba(255, 255, 255, 0.05);
  --tabbar-bg: rgba(21, 24, 30, 0.94);
  --t-gray-bg: #232832; --t-gray: #9aa3b2;
  --t-teal-bg: rgba(60, 180, 175, 0.15); --t-teal: #5fc9c4;
  --t-pink-bg: rgba(232, 100, 160, 0.16); --t-pink: #f08cba;
  --t-rust-bg: rgba(235, 120, 70, 0.16); --t-rust: #f2a07a;
  --t-blue-bg: rgba(90, 150, 235, 0.18); --t-blue: #8cb8f5;
  --t-green-bg: rgba(60, 180, 130, 0.16); --t-green: #63cf9f;
  --t-violet-bg: rgba(150, 130, 235, 0.18); --t-violet: #b3a5f5;
  --t-amber-bg: rgba(250, 178, 25, 0.15);
  --radius: 8px; --ctl: 6px; --pill: 6px; --tag-r: 5px; --ctl-m: 8px; --pill-m: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 28px rgba(0, 0, 0, 0.4);
  --shadow-pop: 0 10px 34px rgba(0, 0, 0, 0.55);
  --side-w: 208px;
  --side-bg: #0d0f13; --side-fg: #e7e9ee; --side-dim: #9aa3b2; --side-hover: #15181e; --side-on: #1b1f28; --side-on-fg: #ffffff; --side-line: #262b35;
  --mark-bg: var(--navy); --mark-fg: #0c0e13; --login-bg: #08090c;
  --fs: 13.5px;
  /* Цвета графиков подобраны под темный фон отдельно. */
  --s-blue: #3987e5; --s-orange: #d95926; --s-aqua: #199e70; --s-yellow: #c98500; --s-magenta: #d55181; --s-gray: #8d96a2; --s-violet: #9085e9; --s-green: #008300; --s-red: #e66767; --s-teal: #2aa7a9; --s-indigo: #7d97d8;
  --st-warn: #fab219; --st-warn-bg: rgba(250, 178, 25, 0.14); --st-crit: #ec6a68; --st-crit-bg: rgba(236, 106, 104, 0.14); --grid: #232832;
}
[data-theme='dark'] .side { border-right: 1px solid var(--line); }
[data-theme='dark'] .nav a.on { box-shadow: inset 2px 0 0 var(--navy); }
[data-theme='dark'] .login-card, [data-theme='dark'] .modal { border: 1px solid var(--line); }
[data-theme='dark'] .tile-v { font-weight: 600; }
[data-theme='dark'] .tbl th { background: var(--panel); }
[data-theme='dark'] .brand-mark.big { color: var(--mark-fg); }
[data-theme='dark'] .savebar { box-shadow: var(--shadow-pop); }

/* ======================= Бумага ======================= */
:root[data-theme='paper'] {
  --navy: #1f5a48; --navy-2: #174637; --navy-3: #2b6f5a;
  --bg: #f4efe4; --panel: #fffdf8; --panel-2: #f9f5ea; --hover: #f8f3e7; --sel: #eee6d4;
  --line: #e0d6c1; --line-2: #ebe3d2; --line-3: #c9bb9d;
  --text: #2a251e; --muted: #6e6555; --faint: #9c937f;
  --blue: #1f5a48; --blue-bg: #e4efe8; --blue-line: #bdd6c8;
  --out: #edf1e6; --out-line: #d3dcc8; --note: #fbf3d3; --note-line: #e8dba6;
  --ring: rgba(31, 90, 72, 0.18); --overlay: rgba(42, 37, 30, 0.42); --hoverband: rgba(42, 37, 30, 0.05);
  --tabbar-bg: rgba(255, 253, 248, 0.96);
  --t-gray-bg: #ebe5d8; --sw-off: #cfc5ae;
  --radius: 3px; --ctl: 3px; --pill: 3px; --tag-r: 2px; --ctl-m: 4px; --pill-m: 4px;
  --shadow: 0 1px 0 rgba(60, 50, 30, 0.05), 0 8px 24px rgba(60, 50, 30, 0.08);
  --shadow-pop: 0 8px 26px rgba(60, 50, 30, 0.18);
  --side-w: 232px;
  --side-small: 0.82;
  --side-bg: #ebe3d1; --side-fg: #2a251e; --side-dim: #5d5546; --side-hover: #e2d9c4; --side-on: #fffdf8; --side-on-fg: #1f5a48; --side-line: #d6cab1;
  --mark-bg: #2a251e; --mark-fg: #f4efe4; --login-bg: #ebe3d1; --login-fg: rgba(42, 37, 30, 0.78);
  --font-head: 'PT Serif', Georgia, 'Times New Roman', serif;
  --fs: 14.5px;
  --grid: #e6dfcf;
}
[data-theme='paper'] .side { border-right: 1px solid var(--side-line); padding: 24px 14px 16px; }
[data-theme='paper'] .brand { padding-bottom: 24px; }
[data-theme='paper'] .brand-name { font-size: 19px; }
[data-theme='paper'] .brand-name small { font-family: var(--font); }
[data-theme='paper'] .nav a.on { font-weight: 700; box-shadow: inset 0 0 0 1px var(--side-line); }
[data-theme='paper'] .topbar { background: var(--bg); min-height: 72px; border-bottom-color: var(--line-3); }
[data-theme='paper'] .topbar h1 { font-size: 27px; letter-spacing: -0.01em; }
[data-theme='paper'] .tiles { gap: 20px; margin-bottom: 22px; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
[data-theme='paper'] .tile { background: transparent; border: 0; border-top: 2px solid var(--text); border-radius: 0; padding: 10px 0 6px; }
[data-theme='paper'] .tile:hover { box-shadow: none; border-top-color: var(--navy); }
[data-theme='paper'] .tile-v { font-size: 40px; font-weight: 400; letter-spacing: -0.01em; }
[data-theme='paper'] .report .tile { background: transparent; border-top-color: var(--text); }
[data-theme='paper'] .card-h, [data-theme='paper'] .report-sec h3, [data-theme='paper'] .section-h { font-family: var(--font-head); font-size: 17px; color: var(--text); }
[data-theme='paper'] .card-h .card-sub, [data-theme='paper'] .report-sec h3 .card-sub { font-family: var(--font); }
[data-theme='paper'] .chips.tabs { gap: 0; box-shadow: inset 0 -1px 0 var(--line); }
[data-theme='paper'] .chips.tabs .chip { border: 0; border-radius: 0; background: none; height: 36px; padding: 0 2px; margin-right: 20px; font-size: 14.5px; }
[data-theme='paper'] .chips.tabs .chip.on { color: var(--text); box-shadow: inset 0 -2px 0 var(--navy); font-weight: 700; }
[data-theme='paper'] .th-sort:hover, [data-theme='mono'] .th-sort:hover { text-decoration: underline; }
[data-theme='paper'] .tbl th { background: transparent; border-bottom: 1px solid var(--text); color: var(--text); font-weight: 700; font-size: 12.5px; }
[data-theme='paper'] .login-card { border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow); }
[data-theme='paper'] .login-card h1 { font-size: 26px; }
[data-theme='paper'] .modal, [data-theme='paper'] .mode, [data-theme='paper'] .savebar, [data-theme='paper'] .toast, [data-theme='paper'] .hintbox, [data-theme='paper'] .bubble, [data-theme='paper'] .brand-mark.big, [data-theme='paper'] .integ-logo, [data-theme='paper'] .pop-menu, [data-theme='paper'] .bulkbar { border-radius: 4px; }
[data-theme='paper'] .help-sec h2 { font-size: 22px; }
@media (max-width: 860px) {
  [data-theme='paper'] .topbar { min-height: 58px; }
  [data-theme='paper'] .topbar h1 { font-size: 22px; }
  [data-theme='paper'] .tiles { gap: 14px; }
  [data-theme='paper'] .tile-v { font-size: 32px; }
  [data-theme='paper'] .chips.tabs .chip { height: 38px; font-size: 15px; }
  [data-theme='paper'] .topbar .search .input { border-radius: 4px; }
}

/* ======================= Яркая ======================= */
:root[data-theme='vivid'] {
  --navy: #5a3df0; --navy-2: #4a2fd8; --navy-3: #7459ff;
  --bg: #f3f1fb; --panel: #ffffff; --panel-2: #f8f6fe; --hover: #f7f5fe; --sel: #ebe7ff;
  --line: #e7e3f4; --line-2: #f0edf9; --line-3: #cfc8ea;
  --text: #1c1838; --muted: #666085; --faint: #9a95b5;
  --blue: #5a3df0; --blue-bg: #ece8ff; --blue-line: #d2c9ff;
  --out: #efecff; --out-line: #dcd5ff;
  --ring: rgba(90, 61, 240, 0.2); --overlay: rgba(28, 24, 56, 0.45); --hoverband: rgba(90, 61, 240, 0.06);
  --t-gray-bg: #eeebf7; --sw-off: #cfc8ea;
  --radius: 18px; --ctl: 12px; --pill: 999px; --tag-r: 999px; --ctl-m: 14px; --pill-m: 999px;
  --shadow: 0 2px 6px rgba(50, 30, 140, 0.06), 0 14px 34px rgba(50, 30, 140, 0.12);
  --shadow-pop: 0 14px 40px rgba(50, 30, 140, 0.22);
  --card-shadow: 0 1px 2px rgba(50, 30, 140, 0.05), 0 8px 24px rgba(50, 30, 140, 0.07);
  --side-w: 224px;
  --side-bg: linear-gradient(165deg, #6a4bff 0%, #4a2fd8 58%, #3a22b8 100%);
  --side-small: 0.9;
  --side-fg: #ffffff; --side-dim: rgba(255, 255, 255, 0.93); --side-hover: rgba(255, 255, 255, 0.13); --side-on: #ffffff; --side-on-fg: #4a2fd8; --side-line: rgba(255, 255, 255, 0.2);
  --mark-bg: #ffffff; --mark-fg: #5a3df0; --login-bg: linear-gradient(150deg, #6a4bff 0%, #3a22b8 100%); --login-fg: rgba(255, 255, 255, 0.92);
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --fs: 14.5px;
  --grid: #ebe7f6;
}
[data-theme='vivid'] .nav { gap: 4px; }
[data-theme='vivid'] .nav a { border-radius: 14px; padding: 11px 14px; font-weight: 600; }
[data-theme='vivid'] .nav a.on { font-weight: 700; box-shadow: 0 8px 18px rgba(20, 10, 80, 0.22); }
[data-theme='vivid'] .nav a.on .badge.amber { background: var(--navy); color: #fff; }
[data-theme='vivid'] .brand-mark { border-radius: 12px; }
[data-theme='vivid'] .brand-name { font-weight: 800; font-size: 16px; }
[data-theme='vivid'] .topbar { background: transparent; border-bottom: 0; min-height: 68px; }
[data-theme='vivid'] .topbar h1 { font-size: 25px; font-weight: 800; letter-spacing: -0.02em; }
[data-theme='vivid'] .topbar .search .input { border-radius: 999px; border-color: transparent; box-shadow: var(--card-shadow); }
[data-theme='vivid'] .topbar .search .input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px var(--ring); }
[data-theme='vivid'] .tag.case { color: var(--navy-2); }
[data-theme='vivid'] .tile, [data-theme='vivid'] .list, [data-theme='vivid'] .report, [data-theme='vivid'] .tpl, [data-theme='vivid'] .integ-card, [data-theme='vivid'] .me-card, [data-theme='vivid'] .card, [data-theme='vivid'] .tpl-note { border-color: transparent; box-shadow: var(--card-shadow); }
[data-theme='vivid'] .botcard { border-top-color: transparent; border-right-color: transparent; border-bottom-color: transparent; box-shadow: var(--card-shadow); }
[data-theme='vivid'] .list.flat { box-shadow: none; }
[data-theme='vivid'] .tiles { gap: 10px; }
[data-theme='vivid'] .tile { padding: 14px 14px 12px; }
[data-theme='vivid'] .tile-s { font-size: 12px; }
[data-theme='vivid'] .tile:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
[data-theme='vivid'] .tile-v { font-size: 38px; font-weight: 800; letter-spacing: -0.03em; }
[data-theme='vivid'] .dash .tiles > .tile:nth-child(5n + 1) { background: #ece7ff; }
[data-theme='vivid'] .dash .tiles > .tile:nth-child(5n + 2) { background: #e3efff; }
[data-theme='vivid'] .dash .tiles > .tile:nth-child(5n + 3) { background: #f5e8fb; }
[data-theme='vivid'] .dash .tiles > .tile:nth-child(5n + 4) { background: #e5f4f8; }
[data-theme='vivid'] .dash .tiles > .tile:nth-child(5n + 5) { background: #e7eaff; }
[data-theme='vivid'] .report .tile { box-shadow: none; }
[data-theme='vivid'] .card-h { font-size: 16px; font-weight: 800; padding: 16px 18px 8px; }
[data-theme='vivid'] .btn { border-radius: 999px; padding: 0 18px; font-weight: 700; }
[data-theme='vivid'] .btn.icon { padding: 0; }
[data-theme='vivid'] .btn.sm { padding: 0 13px; }
[data-theme='vivid'] .btn.sm.icon { padding: 0; }
[data-theme='vivid'] .btn.primary { box-shadow: 0 6px 16px rgba(90, 61, 240, 0.32); }
[data-theme='vivid'] .chip { font-weight: 600; }
[data-theme='vivid'] .chip.on { box-shadow: 0 4px 12px rgba(90, 61, 240, 0.28); }
[data-theme='vivid'] .chats-tools { background: transparent; border-bottom: 0; }
[data-theme='vivid'] .tbl th { background: var(--panel); border-bottom-color: var(--line-2); }
[data-theme='vivid'] .login-card { border-radius: 28px; padding: 32px 28px; }
[data-theme='vivid'] .login-card h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
[data-theme='vivid'] .brand-mark.big { border-radius: 14px; }
[data-theme='vivid'] .modal { border-radius: 24px; padding: 22px; }
[data-theme='vivid'] .bubble { border-radius: 18px; }
[data-theme='vivid'] .pop-menu, [data-theme='vivid'] .hint-pop, [data-theme='vivid'] .tip { border-radius: 14px; }
[data-theme='vivid'] .savebar { border-radius: 999px; padding-left: 22px; }
[data-theme='vivid'] .toast { border-radius: 999px; padding: 10px 20px; }
[data-theme='vivid'] .mode, [data-theme='vivid'] .bulkbar, [data-theme='vivid'] .hintbox, [data-theme='vivid'] .pause, [data-theme='vivid'] .pform { border-radius: 14px; }
[data-theme='vivid'] .segbar { height: 26px; border-radius: 999px; }
[data-theme='vivid'] .meter, [data-theme='vivid'] .meter span { border-radius: 999px; }
@media (min-width: 861px) {
  [data-theme='vivid'] .side { margin: 12px 0 12px 12px; border-radius: 26px; padding: 20px 12px 18px; box-shadow: 0 18px 40px rgba(74, 47, 216, 0.3); }
  [data-theme='vivid'] .chats-body { padding: 0 20px 20px; }
  [data-theme='vivid'] table.chats { border: 0; border-radius: 18px; border-collapse: separate; border-spacing: 0; box-shadow: var(--card-shadow); }
  [data-theme='vivid'] table.chats th:first-child { border-top-left-radius: 18px; }
  [data-theme='vivid'] table.chats th:last-child { border-top-right-radius: 18px; }
  [data-theme='vivid'] table.chats tr:last-child td:first-child { border-bottom-left-radius: 18px; }
  [data-theme='vivid'] table.chats tr:last-child td:last-child { border-bottom-right-radius: 18px; }
  [data-theme='vivid'] .page { padding-top: 8px; }
  [data-theme='vivid'] .tbl th { padding-top: 13px; padding-bottom: 11px; }
  [data-theme='vivid'] .tbl td { padding-top: 12px; padding-bottom: 12px; }
}
@media (max-width: 860px) {
  [data-theme='vivid'] .topbar { min-height: 58px; }
  [data-theme='vivid'] .topbar h1 { font-size: 22px; }
  [data-theme='vivid'] .tile { padding: 13px 14px 11px; }
  [data-theme='vivid'] .tile-v { font-size: 30px; }
  [data-theme='vivid'] .login-card { padding: 26px 22px; }
}

/* ======================= Строгая ======================= */
:root[data-theme='mono'] {
  --navy: #111111; --navy-2: #000000; --navy-3: #333333;
  --bg: #ffffff; --panel: #ffffff; --panel-2: #f5f5f5; --hover: #f5f5f5; --sel: #ececec;
  --line: #dcdcdc; --line-2: #ebebeb; --line-3: #b0b0b0;
  --text: #111111; --muted: #5e5e5e; --faint: #8f8f8f;
  --blue: #0a55c5; --blue-bg: #e8f0fc; --blue-line: #bcd2f5;
  --out: #f0f0f0; --out-line: #d9d9d9;
  --ring: rgba(10, 85, 197, 0.2); --overlay: rgba(0, 0, 0, 0.45); --hoverband: rgba(0, 0, 0, 0.05);
  --t-gray-bg: #ececec; --sw-off: #c4c4c4;
  --radius: 0px; --ctl: 2px; --pill: 2px; --tag-r: 2px; --ctl-m: 3px; --pill-m: 3px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  --shadow-pop: 0 8px 24px rgba(0, 0, 0, 0.2);
  --side-bg: #111111; --side-fg: #ffffff; --side-dim: rgba(255, 255, 255, 0.7); --side-hover: rgba(255, 255, 255, 0.1); --side-on: rgba(255, 255, 255, 0.16); --side-on-fg: #ffffff; --side-line: rgba(255, 255, 255, 0.22);
  --mark-bg: #ffffff; --mark-fg: #111111; --login-bg: #111111;
  --font: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --fs: 13.5px;
  --grid: #e8e8e8;
}
[data-theme='mono'] .tbl th { background: var(--panel); border-bottom: 1px solid var(--text); color: var(--text); }
[data-theme='mono'] .topbar { border-bottom-color: var(--text); }
[data-theme='mono'] .topbar h1 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
/* Числа одной полосой: линии между плитками рисуют сами плитки, пустые места в неполном ряду остаются белыми. */
[data-theme='mono'] .tiles { gap: 0; border: 1px solid var(--text); overflow: hidden; }
[data-theme='mono'] .tile, [data-theme='mono'] .tile:hover { border: 0; box-shadow: inset 0 0 0 1px var(--line); margin: -1px; }
[data-theme='mono'] .tile:hover { background: var(--hover); }
[data-theme='mono'] .tile-v { font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; }
[data-theme='mono'] .report .tiles { margin: 0 16px 6px; padding: 0; }
[data-theme='mono'] .report .tile { background: var(--panel); }
[data-theme='mono'] .card, [data-theme='mono'] .list, [data-theme='mono'] .report { border-color: var(--line-3); }
[data-theme='mono'] .list.flat { border-color: var(--line-2); }
[data-theme='mono'] .card-h { font-weight: 600; border-bottom: 1px solid var(--line); padding: 9px 14px; background: var(--panel-2); }
[data-theme='mono'] .card-h + * { margin-top: 12px; }
[data-theme='mono'] .card-h + .list.flat { margin-top: 0; border-top: 0; }
[data-theme='mono'] .btn { font-weight: 500; }
[data-theme='mono'] .btn.primary { font-weight: 600; }
[data-theme='mono'] .chip { font-weight: 500; }
[data-theme='mono'] .login-card, [data-theme='mono'] .modal, [data-theme='mono'] .mode, [data-theme='mono'] .savebar, [data-theme='mono'] .toast, [data-theme='mono'] .hintbox, [data-theme='mono'] .bubble, [data-theme='mono'] .brand-mark, [data-theme='mono'] .brand-mark.big, [data-theme='mono'] .integ-logo, [data-theme='mono'] .pop-menu, [data-theme='mono'] .bulkbar, [data-theme='mono'] .theme-prev, [data-theme='mono'] .tip, [data-theme='mono'] .segbar, [data-theme='mono'] .pause, [data-theme='mono'] .pform, [data-theme='mono'] .tpl-body { border-radius: 2px; }
[data-theme='mono'] .login-card { border-radius: 0; }
[data-theme='mono'] .chats-tools { border-bottom-color: var(--line-3); }
/* Фон страницы здесь белый, поэтому вставки внутри карточек - серые. */
[data-theme='mono'] .tpl-body, [data-theme='mono'] code, [data-theme='mono'] .copy code, [data-theme='mono'] .outq-row:not(.bad):not(.unk), [data-theme='mono'] .invite-who, [data-theme='mono'] .ex-row .q { background: var(--panel-2); }
[data-theme='mono'] .rv-row:hover { background: var(--hover); }
[data-theme='mono'] .day span { background: var(--panel); }
@media (min-width: 861px) {
  /* Меню - полосой сверху, содержимое на всю ширину. */
  [data-theme='mono'] .app { flex-direction: column; }
  [data-theme='mono'] .side { width: auto; height: 50px; flex-direction: row; align-items: stretch; padding: 0 20px; }
  [data-theme='mono'] .brand { padding: 0 22px 0 0; }
  [data-theme='mono'] .side .brand-mark { width: 28px; height: 28px; font-size: 10px; }
  [data-theme='mono'] .brand-name { white-space: nowrap; }
  [data-theme='mono'] .brand-name small { display: none; }
  [data-theme='mono'] .nav { flex-direction: row; gap: 0; flex: 1; min-width: 0; }
  [data-theme='mono'] .nav a { border-radius: 0; padding: 0 13px; gap: 6px; white-space: nowrap; }
  [data-theme='mono'] .nav a > svg.ic { display: none; }
  [data-theme='mono'] .nav a.on { background: none; box-shadow: inset 0 -3px 0 #fff; font-weight: 600; }
  [data-theme='mono'] .nav a.nav-help { margin: 0 0 0 auto; }
  [data-theme='mono'] .nav .badge, [data-theme='mono'] .nav .newdot { margin-left: 2px; }
  [data-theme='mono'] .side-foot { margin: 0; padding: 0 0 0 16px; border-top: 0; border-left: 1px solid var(--side-line); display: flex; align-items: center; gap: 14px; white-space: nowrap; }
  [data-theme='mono'] .side-foot .who { margin: 0; }
  /* В меню сверху строке о программе места нет: она остается на странице входа и в справке. */
  [data-theme='mono'] .side-credit { display: none; }
  [data-theme='mono'] .side-foot .who small { display: none; }
  [data-theme='mono'] .side-foot button { display: inline-flex; align-items: center; gap: 5px; }
  [data-theme='mono'] .main { min-height: 0; }
  [data-theme='mono'] .topbar { min-height: 50px; padding: 8px 24px; }
  [data-theme='mono'] .page, [data-theme='mono'] .page.wide { max-width: none; padding: 16px 24px 40px; }
  [data-theme='mono'] .page.help { max-width: 1000px; }
  [data-theme='mono'] .chats-tools { padding: 10px 24px; }
  [data-theme='mono'] .tbl td { padding: 6px 12px; }
  [data-theme='mono'] .tbl th { padding: 7px 12px; }
  [data-theme='mono'] .lrow { padding: 7px 12px; }
  [data-theme='mono'] .tile { padding: 10px 14px 9px; }
}
@media (min-width: 861px) and (max-width: 1080px) {
  [data-theme='mono'] .side-foot .who { display: none; }
  [data-theme='mono'] .nav a { padding: 0 10px; }
}
@media (max-width: 860px) {
  [data-theme='mono'] .topbar .search .input { border-radius: 3px; }
  [data-theme='mono'] .tiles { grid-template-columns: 1fr 1fr; }
}

/* ---------- кот в боковом меню ---------- */
/* Отметка "стили кота на странице": без нее страница кота не рисует (см. cat.js). */
:root { --cat: 1; }
/* Свободное место между меню и именем пользователя: кот сидит на линии над именем. В оформлении с меню сверху его нет. */
.cat-zone { flex: 1; min-height: 0; position: relative; display: flex; align-items: flex-end; justify-content: flex-end; padding: 0 10px; overflow: hidden; }
[data-theme='mono'] .cat-zone { display: none; }
.cat-spot { position: relative; display: flex; }
.cat-spot.off { visibility: hidden; }
.cat { display: block; width: 56px; height: 45px; padding: 0; margin: 0 0 -1px; border: 0; background: none; color: var(--side-fg); opacity: 0.45; transition: opacity 0.2s; -webkit-tap-highlight-color: transparent; }
.cat:hover, .cat.on, .cat.has-paw, .cat.happy { opacity: 0.95; }
/* С клавиатуры на кота не попасть (он вне обхода по Tab), поэтому рамки фокуса у него нет. */
.cat:focus, .cat:focus-visible { outline: none; }
.cat-svg { display: block; width: 100%; height: 100%; overflow: visible; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transform-origin: 50% 100%; }
.cat-svg .dot { fill: currentColor; stroke: none; }
.cat-svg .cat-whiskers { stroke-width: 1.1; }
.cat-svg g { transform-box: fill-box; }
.cat-tail { transform-origin: 0% 100%; }
.cat-head { transform-origin: 50% 100%; }
.cat-eyes { transform-origin: 50% 50%; }
.cat-arm { display: none; transform-origin: 100% 100%; }
.cat.has-paw .cat-arm { display: block; animation: cat-wave 1.1s ease-in-out infinite; }
.cat.awake .cat-tail { animation: cat-tail 5s ease-in-out infinite; }
.cat.awake .cat-eyes { animation: cat-blink 6.5s infinite; }
.cat.sleep .cat-svg { animation: cat-breathe 4.5s ease-in-out infinite; }
@keyframes cat-tail { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-9deg); } }
@keyframes cat-blink { 0%, 94%, 100% { transform: scaleY(1); } 96.5% { transform: scaleY(0.1); } }
@keyframes cat-breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.035); } }
@keyframes cat-wave { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(16deg); } }
@media (prefers-reduced-motion: reduce) { .cat *, .cat-svg { animation: none !important; } }
/* Что кот "говорит": мурчание и от кого пришла лапка. */
.cat-say { position: absolute; right: 2px; bottom: calc(100% + 6px); width: max-content; max-width: 176px; padding: 5px 9px; border-radius: 10px 10px 3px 10px;
  background: var(--mark-bg); color: var(--mark-fg); font-size: 12px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18); }
.cat-say.paw { cursor: pointer; }
/* Окно "Передать лапку" - поверх страницы, справа от меню. */
.cat-pop { position: fixed; z-index: 60; width: 272px; max-height: min(500px, calc(100vh - 24px)); display: flex; flex-direction: column; gap: 8px; padding: 12px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-pop); font-family: var(--font); }
.cat-pop-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 2px; }
.cat-people { min-height: 0; overflow: auto; margin: 0 -6px -6px; }
.cat-people .csearch-row:disabled { opacity: 0.5; cursor: default; background: none; }
.cat-none { padding: 8px 10px; }
/* Список коллег стал длиннее: сжимается только он, а не поля над ним. */
.cat-pop > .field, .cat-pop > .input, .cat-pop > .cat-pop-h { flex: none; }
/* Внизу окна: коллеги из других отделов - пока только обещание. */
.cat-more { flex: none; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12.5px; }
.cat-more summary { cursor: pointer; color: var(--muted); }
.cat-more summary:hover { color: var(--text); }
.cat-more div { margin-top: 6px; }
/* Игра: свободное место меню становится полем. */
.cat-game { position: absolute; inset: 0; display: flex; flex-direction: column; padding-top: 10px; color: var(--side-dim); font-size: 12px; user-select: none; -webkit-user-select: none; }
.cat-hud { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 0 8px 4px; white-space: nowrap; }
.cat-hud .grow { flex: 1; }
.cat-hud b { color: var(--side-fg); }
.cat-dots { display: inline-flex; gap: 4px; }
.cat-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--side-line); }
.cat-dots i.on { background: var(--side-fg); }
.cat-x { flex: none; border: 0; background: none; color: inherit; font-size: 18px; line-height: 1; padding: 0 2px; margin-left: 2px; }
.cat-x:hover { color: var(--side-fg); }
.cat-field { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.cat-thrower { position: absolute; left: 0; top: 0; width: 40px; height: 32px; color: var(--side-fg); will-change: transform; }
.cat-item { position: absolute; left: 0; top: 0; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--side-line); background: var(--side-on); color: var(--side-on-fg); will-change: transform; }
.cat-item svg.ic { width: 16px; height: 16px; }
.cat-item.bad { border-color: transparent; background: var(--red); color: var(--on-solid); font-size: 9.5px; font-weight: 800; letter-spacing: 0.02em; }
.cat-bag { position: absolute; left: 0; bottom: 2px; width: 36px; height: 36px; color: var(--side-fg); will-change: transform; }
.cat-bag svg.ic { width: 36px; height: 36px; stroke-width: 1.5; }
.cat-flash { position: absolute; left: 0; right: 0; top: 38%; padding: 0 6px; text-align: center; color: var(--side-fg); font-size: 13px; font-weight: 700; pointer-events: none; }
.cat-over { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--side-fg); font-size: 13px; text-align: center; }
.cat-over b { font-size: 15px; margin-bottom: 4px; }
.cat-over .dim { color: var(--side-dim); font-size: 12px; }
.cat-over-b { display: flex; gap: 6px; margin-top: 10px; }
.cat-btn { height: 28px; padding: 0 10px; border-radius: var(--ctl); border: 1px solid var(--side-line); background: var(--side-on); color: var(--side-on-fg); font-size: 12.5px; font-weight: 600; }
.cat-btn.ghost { background: none; color: var(--side-dim); }
.cat-btn.ghost:hover { color: var(--side-fg); }

/* Печать отчета из темного оформления - на белом листе. */
@media print {
  :root[data-theme='dark'] {
    color-scheme: light;
    --navy: #1d3045; --navy-3: #2a4360; --on-accent: #fff; --on-solid: #fff;
    --bg: #f4f6f8; --panel: #fff; --panel-2: #fafbfc; --line: #dce2e8; --line-2: #e9edf1; --line-3: #c4ced8;
    --text: #1d3045; --muted: #66768a; --faint: #95a2b1;
    --green: #2e7d5b; --green-bg: #e6f3ec; --red: #a23b3b; --red-bg: #f8e6e6; --blue: #2f6fb2; --blue-bg: #e6eff9; --out: #e9f0f7; --out-line: #d3e0ec;
    --warn-text: #7a5200; --t-gray-bg: #eceff2;
    --s-blue: #2a78d6; --s-orange: #eb6834; --s-aqua: #1baf7a; --s-yellow: #eda100; --s-magenta: #e87ba4; --s-gray: #a9b3bf; --s-violet: #4a3aa7; --s-green: #008300; --s-red: #e34948; --s-teal: #0f8b8d; --s-indigo: #3b5ba5;
    --st-warn: #fab219; --st-warn-bg: #fdf3d8; --st-crit: #d03b3b; --st-crit-bg: #fbe9e9; --grid: #e6eaee;
  }
}

/* ---------- задачи ---------- */
.tasks-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tasks-top select.input { width: auto; max-width: 280px; }
.tasks-page .section { margin-bottom: 18px; }
.tcount { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--line-2); border-radius: 10px; padding: 1px 8px; }
.task { border-bottom: 1px solid var(--line-2); }
.task:last-child { border-bottom: 0; }
.task > .lrow { border-bottom: 0; }
.task-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-3); flex: none; margin: 0 9px 0 9px; }
.task-dot.hot { background: var(--red); }
.task-check { flex: none; gap: 4px; margin-right: 6px; }
.task-check:hover { border-color: var(--green, #2e7d32); color: var(--green, #2e7d32); }
.task-links { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 0; }
.task .main-c.no-go { cursor: default; }
.hintbox.diffs, .hintbox.closing { margin: 8px 0; }
.task-sub { padding: 0 14px 10px 40px; }
.task-form { gap: 10px; }
.hintbox.deleg { margin-top: 8px; }
@media (max-width: 640px) {
  .tasks-top select.input { max-width: 100%; flex: 1 1 100%; }
  .task-sub { padding-left: 14px; }
}
.hintbox .task-form { width: 100%; }
@media (max-width: 640px) {
  .task > .lrow { flex-wrap: nowrap; }
  .task > .lrow .when { font-size: 12px; }
}

/* ---------- База знаний: трек, документы, поиск, документ поверх страницы ---------- */
.page.help.kb-page { max-width: 1280px; }
.help-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.help-tabs .chip .ic { width: 12px; height: 12px; }
.kb { display: flex; flex-direction: column; gap: 14px; }
.kb-pad { padding: 20px 4px; }
.kb .linkbtn, .kb-rd .linkbtn, .kb-chat .linkbtn { border: 0; background: none; padding: 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--blue); cursor: pointer; text-align: left; text-decoration: none; min-height: 24px; }
.kb .linkbtn:hover, .kb-rd .linkbtn:hover, .kb-chat .linkbtn:hover { text-decoration: underline; }
.kb .linkbtn.small, .kb-chat .linkbtn.small { font-size: 12.5px; font-weight: 500; }
.kb .linkbtn.src { font-weight: 500; color: var(--muted); font-size: 12.5px; text-decoration: underline; text-decoration-color: var(--line-3); }
.kb .linkbtn.src:hover { color: var(--text); }
.kb mark, .kb-rd mark { background: var(--st-warn-bg); color: inherit; border-radius: 3px; padding: 0 1px; box-shadow: inset 0 -2px 0 var(--warn-line); }
.kb-top { display: flex; align-items: center; gap: 10px; }
.kb-sbox { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: var(--input-bg); border: 1px solid var(--line-3); border-radius: 12px; padding: 0 8px 0 14px; min-height: 50px; box-shadow: var(--shadow); color: var(--muted); }
.kb-sbox:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px var(--ring); }
.kb-sbox input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: var(--text); height: 48px; }
.kb-sbox input::-webkit-search-cancel-button { display: none; }
.kb-sbox kbd { font: 600 11.5px/1 inherit; color: var(--muted); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 4px 6px; background: var(--panel-2); }
.kb-dot { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--green); background: var(--green-bg); border-radius: var(--tag-r); padding: 5px 9px; text-decoration: none; white-space: nowrap; }
.kb-dot i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.kb-dot.bad { color: var(--red); background: var(--red-bg); }
.kb-sugg { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: -4px; }
.kb-q { border: 1px dashed var(--line-3); background: var(--panel-2); border-radius: var(--ctl); padding: 4px 10px; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; min-height: 30px; }
.kb-q:hover { border-color: var(--blue); background: var(--blue-bg); }
.kb-wait { border-style: dashed; }

/* Метки видов документов. */
.kb-ic { width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center; flex: none; background: var(--blue-bg); color: var(--blue); }
.kb-ic .ic { width: 12px; height: 12px; }
.kb-ic.k-reg { background: var(--violet-bg); color: var(--violet); }
.kb-ic.k-ins { background: var(--blue-bg); color: var(--blue); }
.kb-ic.k-pam { background: var(--t-teal-bg); color: var(--t-teal); }
.kb-ic.k-tab { background: var(--green-bg); color: var(--green); }
.kb-ic.k-ai { background: var(--orange-bg); color: var(--orange); }
.kb-ic.k-cli { background: var(--gold-bg); color: var(--gold); }
.kb-ic.k-fld { background: var(--t-gray-bg); color: var(--t-gray); }
.kb-dk { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); border-radius: var(--ctl); padding: 3px 9px 3px 4px; font: inherit; font-size: 13px; color: var(--text); max-width: 100%; min-height: 30px; cursor: pointer; text-align: left; text-decoration: none; }
.kb-dk:hover { border-color: var(--line-3); background: var(--hover); color: var(--text); text-decoration: none; }
.kb-dk .ic.faint { width: 12px; height: 12px; flex: none; }
.kb-dk-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.kb-dk-d { margin-left: auto; padding-left: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.kb-dk.draft { border-style: dashed; color: var(--muted); }
.kb-dk.off { cursor: default; color: var(--muted); border-style: dashed; }
.kb-dk.off:hover { background: var(--panel); border-color: var(--line); }
.kb-dk.ln { border: 0; background: none; padding: 3px 0; min-height: 28px; width: 100%; }
.kb-dk.ln:hover { background: none; color: var(--blue); }
.kb-dk.ln .kb-ic { width: 18px; height: 18px; }
.kb-mini { font-size: 10.5px; font-weight: 700; color: var(--warn-text); background: var(--st-warn-bg); border-radius: var(--tag-r); padding: 0 5px; white-space: nowrap; }
.kb-docs { display: flex; flex-wrap: wrap; gap: 6px; }
.kb-grp { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.kb-grp > b { font-size: 13px; margin: 4px 0 1px; }

/* Трек. */
.kb-trk { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.kb-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; background: var(--line-2); border-radius: 10px; padding: 3px; }
.kb-seg button { border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 13.5px; color: var(--muted); padding: 6px 14px; border-radius: 8px; cursor: pointer; min-height: 34px; }
.kb-seg button:hover { color: var(--text); }
.kb-seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(18, 35, 58, 0.12); }
.kb-pl { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 13px 0 8px; border-radius: 10px; border: 1px dashed var(--t-teal); background: var(--panel); color: var(--t-teal); font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.kb-pl:hover { background: var(--t-teal-bg); }
.kb-pb { width: 20px; height: 20px; border-radius: 6px; background: var(--t-teal-bg); color: var(--t-teal); display: grid; place-items: center; font-weight: 800; font-size: 15px; line-height: 1; flex: none; }
.kb-pl.on { background: var(--t-teal); border: 1px solid var(--t-teal); color: var(--on-solid); }
.kb-pl.on .kb-pb { background: var(--panel); color: var(--t-teal); }
.kb-trk-sub { margin: 0; color: var(--muted); font-size: 13px; flex: 1 1 100%; }
.kb-trk-sub .linkbtn { font-weight: 500; font-size: 13px; min-height: 0; }
.kb-plus { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; border-color: var(--t-teal); background: var(--t-teal-bg); }
.kb-plus-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.kb-plus-h h3 { margin: 0; font-size: 16px; color: var(--t-teal); }
.kb-plus .kb-pb { background: var(--t-teal); color: var(--on-solid); }
.kb-cmp { display: grid; grid-template-columns: minmax(130px, 0.8fr) minmax(0, 1fr) minmax(0, 1fr); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.kb-cmp span { padding: 7px 10px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.kb-cmp .kb-ch { font-weight: 700; color: var(--muted); background: var(--panel-2); font-size: 12px; }
.kb-cmp .kb-cp { color: var(--t-teal); font-weight: 600; }
.kb-plus-f { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 13px; }
.kb-phases { display: flex; flex-wrap: wrap; gap: 8px; }
.kb-ph { display: inline-flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 4px 12px 4px 4px; color: var(--text); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
.kb-ph:hover { border-color: var(--line-3); }
.kb-ph-n { width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: var(--on-accent); font-size: 12px; display: grid; place-items: center; }
.kb-ph small { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.kb-cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.kb-tl { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; }
.kb-aside { flex: 1 1 290px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.kb-ph-h { font-size: 13px; color: var(--muted); font-weight: 700; margin: 14px 0 10px 46px; scroll-margin-top: 12px; }
.kb-stage { display: flex; gap: 14px; scroll-margin-top: 16px; }
.kb-rail { flex: none; width: 32px; display: flex; flex-direction: column; align-items: center; }
.kb-num { width: 32px; height: 32px; border-radius: 50%; background: var(--panel); border: 2px solid var(--navy); color: var(--text); font-weight: 700; font-size: 13px; display: grid; place-items: center; flex: none; }
.kb-line { flex: 1; width: 2px; background: var(--line); margin: 4px 0; }
.kb-st { flex: 1; min-width: 0; padding: 14px 16px 12px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; transition: box-shadow 0.4s; }
.kb-stage.flash .kb-st { box-shadow: 0 0 0 3px var(--ring); border-color: var(--focus); }
.kb-st-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.kb-st-h h3 { margin: 0; font-size: 16px; font-weight: 700; }
.kb-time { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--warn-text); background: var(--gold-bg); border-radius: var(--tag-r); padding: 2px 8px; }
.kb-time .ic { width: 12px; height: 12px; }
.kb-roles { display: flex; flex-wrap: wrap; gap: 4px; }
.kb-role { font-size: 11.5px; font-weight: 600; border-radius: var(--tag-r); padding: 1px 8px; line-height: 18px; background: var(--t-gray-bg); color: var(--t-gray); }
.kb-role.co { background: var(--t-blue-bg); color: var(--t-blue); }
.kb-role.ex { background: var(--t-teal-bg); color: var(--t-teal); }
.kb-role.os { background: var(--t-violet-bg); color: var(--t-violet); }
.kb-role.cl { background: var(--t-rust-bg); color: var(--t-rust); }
.kb-role.tr { background: var(--gold-bg); color: var(--gold); }
.kb-story { margin: 0; font-size: 14px; line-height: 1.55; }
.kb-note { font-size: 13px; background: var(--note); border: 1px solid var(--note-line); border-radius: 8px; padding: 6px 10px; }
.kb-plusnote { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; background: var(--t-teal-bg); border: 1px solid var(--t-teal); color: var(--text); border-radius: 8px; padding: 6px 10px; }
.kb-plusnote b { flex: none; width: 18px; height: 18px; border-radius: 5px; background: var(--t-teal); color: var(--on-solid); display: grid; place-items: center; font-size: 13px; line-height: 1; margin-top: 1px; }
.kb-rule { background: var(--orange-bg); border-color: var(--orange-line); }
.kb-rule b { background: var(--orange); }
.kb-warnline { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: 13px; background: var(--red-bg); border: 1px solid var(--crit-line); color: var(--red); border-radius: 8px; padding: 6px 10px; }
.kb-warnline .ic { width: 14px; height: 14px; }
.kb-st-f { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; border-top: 1px solid var(--line-2); padding-top: 8px; margin-top: 2px; }
.kb-tasks { margin: 0; padding: 2px 0 2px 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.kb-tail { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 16px; margin-left: 46px; background: var(--sel); }
.kb-tail span { flex: 1 1 260px; }
.kb-box { padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.kb-box h3 { margin: 0; font-size: 13px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.kb-opt { display: flex; flex-direction: column; gap: 2px; padding: 7px 0; border-bottom: 1px solid var(--line-2); align-items: flex-start; }
.kb-opt:last-child { border-bottom: 0; padding-bottom: 0; }
.kb-opt b { font-size: 13.5px; }
.kb-opt span { font-size: 12.5px; color: var(--muted); }

/* Поиск. */
.kb-res { display: flex; flex-direction: column; gap: 12px; }
.kb-fixed { margin: 0; }
.kb-ans { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; border-color: var(--blue-line); background: var(--blue-bg); }
.kb-ans-h { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; color: var(--blue); }
.kb-ans-t { margin: 0; font-size: 15.5px; line-height: 1.55; }
.kb-off { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 12.5px; color: var(--muted); }
.kb-offt { font-size: 11px; font-weight: 700; border-radius: var(--tag-r); padding: 1px 7px; background: var(--line-2); color: var(--muted); }
.kb-terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.kb-term { padding: 10px 12px; font-size: 13.5px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.kb-term b { font-size: 14px; }
.kb-rk { align-items: center; }
.kb-gh { margin: 6px 0 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.kb-hits { display: flex; flex-direction: column; gap: 6px; }
.kb-hit { display: flex; flex-direction: column; gap: 3px; text-align: left; width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; font: inherit; color: var(--text); cursor: pointer; text-decoration: none; }
.kb-hit:hover { border-color: var(--line-3); background: var(--hover); color: var(--text); text-decoration: none; }
.kb-hit-k { font-size: 12px; color: var(--muted); font-weight: 600; }
.kb-hit-t { font-size: 14.5px; font-weight: 700; }
.kb-hit-s { font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.kb-hit.row-hit { flex-direction: row; align-items: center; gap: 10px; }
.kb-hit.row-hit .kb-ic { width: 24px; height: 24px; border-radius: 6px; }
.kb-hit-m { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.kb-hit-m .kb-hit-t { font-size: 14px; }
.kb-hit-d { margin-left: auto; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.kb-none { padding: 22px 20px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }

/* Документы. */
.kb-sync { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; border-color: var(--green-line); background: var(--tint-ok); }
.kb-sync.bad { border-color: var(--crit-line); background: var(--red-bg); }
.kb-sync-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kb-sync-h > .ic { width: 16px; height: 16px; color: var(--green); }
.kb-sync.bad .kb-sync-h > .ic { color: var(--red); }
.kb-sync code { font-size: 12px; }
.kb-warn { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; border-color: var(--crit-line); background: var(--red-bg); }
.kb-warn-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--red); }
.kb-warn-h .ic { width: 14px; height: 14px; }
.kb-warn > button, .kb-warn > span { border: 0; background: none; padding: 2px 0; font: inherit; font-size: 13px; color: var(--text); text-align: left; }
.kb-warn > button { cursor: pointer; text-decoration: underline; text-decoration-color: var(--crit-line); }
.kb-miss-l { display: flex; flex-wrap: wrap; gap: 6px; }
.kb-mq { font-size: 13px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--ctl); padding: 2px 8px; }
.kb-mq b { color: var(--muted); font-size: 12px; }
.kb-unused { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; border-color: var(--orange-line); background: var(--tint-warn); }
.kb-unused .kb-warn-h { color: var(--orange); }
.kb-kinds { align-items: center; }
.kb-dl { overflow: hidden; }
.kb-dl-h, .kb-dl-r { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 90px; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--line-2); align-items: start; }
.kb-dl-h { font-size: 12px; color: var(--muted); font-weight: 700; background: var(--panel-2); }
.kb-dl-r:last-child { border-bottom: 0; }
.kb-dl-r.hidden { opacity: 0.6; }
.kb-dl-t { display: flex; flex-direction: column; min-width: 0; }
.kb-dl-t .kb-dk.ln { font-size: 14px; padding: 2px 0; min-height: 26px; }
.kb-dl-t .small { margin-left: 25px; }
.kb-use { display: flex; flex-wrap: wrap; gap: 4px; }
.kb-use span { font-size: 12px; background: var(--sel); color: var(--text); border-radius: var(--tag-r); padding: 1px 7px; }
.kb-chg-g { display: flex; flex-direction: column; gap: 4px; }
.kb-chg-g h4 { margin: 8px 0 2px; font-size: 13px; color: var(--muted); }
.kb-chg-r { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 4px 0; border-bottom: 1px solid var(--line-2); }
.kb-chg-r:last-child { border-bottom: 0; }

/* Документ поверх страницы (и поверх карточки чата). */
.kb-rd-back { position: fixed; inset: 0; background: var(--overlay); z-index: 60; }
.kb-rd { position: fixed; top: 0; right: 0; bottom: 0; width: min(980px, 100vw); background: var(--bg); z-index: 61; display: flex; flex-direction: column; box-shadow: -8px 0 32px rgba(18, 35, 58, 0.2); }
.kb-rd-h { background: var(--panel); border-bottom: 1px solid var(--line); padding: 12px 16px 10px; display: flex; flex-direction: column; gap: 6px; flex: none; }
.kb-rd-top { display: flex; align-items: flex-start; gap: 12px; }
.kb-rd-top h2 { margin: 2px 0 0; font-size: 18px; line-height: 1.3; flex: 1; min-width: 0; font-family: var(--font-head); }
.kb-rd-acts { display: flex; gap: 6px; flex: none; align-items: center; }
.kb-rd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; color: var(--muted); }
.kb-rd-use { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kb-uchip { border: 1px solid var(--out-line); background: var(--sel); color: var(--text); border-radius: var(--ctl); padding: 2px 8px; font: inherit; font-size: 12.5px; cursor: pointer; min-height: 26px; }
.kb-uchip:hover { border-color: var(--blue); color: var(--blue); }
.kb-uchip.plain { cursor: default; }
.kb-uchip.plain:hover { border-color: var(--out-line); color: var(--text); }
.kb-rd-scroll { flex: 1; overflow-y: auto; padding: 14px 16px 48px; }
.kb-rd-cols { display: flex; gap: 16px; align-items: flex-start; }
.kb-toc { flex: 0 0 230px; position: sticky; top: 0; max-height: calc(100vh - 140px); overflow-y: auto; display: flex; flex-direction: column; gap: 1px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.kb-toc span { font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 4px 8px; }
.kb-toc button { border: 0; background: none; text-align: left; font: inherit; font-size: 12.5px; color: var(--muted); padding: 5px 8px; border-radius: 6px; cursor: pointer; line-height: 1.35; }
.kb-toc button.lv2 { padding-left: 18px; }
.kb-toc button.lv3 { padding-left: 28px; }
.kb-toc button:hover { background: var(--sel); color: var(--text); }
.kb-toc button.on { background: var(--blue-bg); color: var(--blue); font-weight: 600; }
.kb-rd-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.kb-qbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; background: var(--st-warn-bg); border: 1px solid var(--warn-line); border-radius: 8px; padding: 6px 10px; }
.kb-qbar .linkbtn { min-height: 0; font-size: 13px; }
.kb-doc { padding: 4px 26px 22px; font-size: 14.5px; line-height: 1.6; }
.kb-doc-sub { margin: 0; font-size: 13.5px; color: var(--muted); }
.kb-sec { padding: 14px 0 4px; scroll-margin-top: 8px; border-radius: 4px; }
.kb-sec.on { background: var(--sel); box-shadow: 0 0 0 12px var(--sel); }
.kb-sec h3 { margin: 0 0 8px; font-size: 17px; line-height: 1.35; font-family: var(--font-head); }
.kb-sec h4 { margin: 12px 0 6px; font-size: 14px; }
.kb-sec p { margin: 0 0 8px; overflow-wrap: anywhere; }
.kb-sec a { color: var(--blue); }
.kb-sec a.kb-in { text-decoration: underline; text-decoration-style: dotted; }
.kb-list { display: flex; flex-direction: column; gap: 3px; margin: 0 0 10px; }
.kb-li { display: flex; gap: 8px; overflow-wrap: anywhere; }
.kb-li-m { flex: none; min-width: 16px; color: var(--muted); text-align: right; }
.kb-li.lv1 { padding-left: 22px; }
.kb-li.lv2 { padding-left: 44px; }
.kb-li.lv3, .kb-li.lv4 { padding-left: 66px; }
.kb-img { display: block; margin: 6px 0 14px; max-width: 100%; }
.kb-tbl .kb-img { margin: 6px 0; }
.kb-img img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: zoom-in; }
.kb-tbl { overflow-x: auto; margin: 4px 0 12px; border: 1px solid var(--line); border-radius: 8px; }
.kb-tbl table { border-collapse: collapse; width: 100%; font-size: 13.5px; line-height: 1.45; }
.kb-tbl th, .kb-tbl td { padding: 7px 10px; border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.kb-tbl th { background: var(--panel-2); font-weight: 700; font-size: 12.5px; color: var(--muted); }
.kb-tbl tr:last-child td { border-bottom: 0; }
.kb-tbl td:last-child, .kb-tbl th:last-child { border-right: 0; }
.kb-empty-doc { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

/* Карточка чата. */
.kb-chat { display: flex; flex-direction: column; gap: 6px; }
.kb-chat .kb-dk.ln { font-size: 13px; }

@media (max-width: 860px) {
  .kb-ph-h, .kb-tail { margin-left: 0; }
  .kb-dl-h { display: none; }
  .kb-dl-r { grid-template-columns: 1fr; gap: 4px; }
  .kb-rd-cols { flex-direction: column; }
  .kb-toc { position: static; flex: none; width: 100%; max-height: none; }
  .kb-doc { padding: 2px 14px 16px; }
  .kb-rd-scroll { padding: 10px 10px 40px; }
  .kb-cmp { grid-template-columns: 1fr 1fr 1fr; }
  .kb-sbox input { font-size: 16px; }
  .kb-top { flex-wrap: wrap; }
  .kb-sugg { display: none; }
  .help-sep { display: none; }
}
@media (max-width: 520px) {
  .kb-cmp { grid-template-columns: 1fr; }
  .kb-cmp .kb-ch:first-child { display: none; }
  .kb-stage { gap: 8px; }
  .kb-rail { width: 26px; }
  .kb-num { width: 26px; height: 26px; font-size: 12px; }
}

/* ---------- 0.8.6: Telegram в карточке, согласование отправки ---------- */
.lead-feed > .pinbar { flex: none; }
.pinbar { border-bottom: 1px solid var(--line); background: var(--panel); max-height: 50%; display: flex; flex-direction: column; }
.pinbar-h { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 20px; border: 0; background: none; text-align: left; color: var(--text); cursor: pointer; }
.pinbar-h:hover { background: var(--hover); }
.pinbar-h > .ic:first-child { color: var(--blue); flex: none; }
.pinbar-t { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: 12.5px; }
.pinbar-t b { color: var(--blue); font-weight: 600; }
.pinbar-t span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.pinlist { overflow-y: auto; padding: 0 20px 10px; display: flex; flex-direction: column; gap: 8px; }
.pin { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--bg); font-size: 13px; }
.pin-meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--faint); margin-bottom: 4px; }
.pin-meta b { color: var(--muted); font-weight: 600; }
.pin-text { white-space: pre-wrap; word-break: break-word; }
.pin .linkbtn { border: 0; background: none; padding: 0; color: var(--blue); font-size: 12px; margin-top: 4px; }
.pin-tg, .m-tg { color: var(--faint); display: inline-flex; }
.pin-tg:hover, .m-tg:hover { color: var(--blue); }
.msg { position: relative; align-items: flex-start; gap: 4px; }
.msg.out { flex-direction: row-reverse; justify-content: flex-start; }
.m-acts { display: flex; flex-direction: column; gap: 2px; opacity: 0; transition: opacity 0.12s; }
.msg:hover .m-acts, .m-acts:focus-within { opacity: 1; }
.m-acts .btn { width: 26px; height: 26px; color: var(--faint); }
@media (hover: none) { .m-acts { display: none; } }
.m-flag { font-size: 11px; color: var(--faint); font-style: italic; }
.bubble .quote { display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--blue); background: var(--blue-bg); border-radius: 4px; padding: 4px 8px; margin: 2px 0 5px; font-size: 12px; color: var(--muted); cursor: pointer; }
.bubble .quote b { color: var(--blue); font-weight: 600; }
.bubble .quote span { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.file-att { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 9px; margin-bottom: 4px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); font-size: 12.5px; }
.file-att span:not(.faint) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.msg.deleted .bubble { opacity: 0.7; border-style: dashed; }
.rx-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.rx { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; line-height: 1; padding: 3px 7px; border-radius: 12px; background: var(--line-2); }
.rx.team { background: var(--blue-bg); box-shadow: inset 0 0 0 1px var(--blue-line); }
.rx b { font-size: 11px; color: var(--muted); }
.bubble .text a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.f-b { font-weight: 700; }
.f-i { font-style: italic; }
.f-u { text-decoration: underline; }
.f-s { text-decoration: line-through; }
.f-code, .f-pre { font-family: ui-monospace, Menlo, monospace; font-size: 0.92em; background: var(--line-2); border-radius: 4px; padding: 0 3px; }
.f-at { color: var(--blue); }
.f-q { display: inline; border-left: 3px solid var(--line-3); padding-left: 6px; color: var(--muted); }
.f-sp { background: var(--line-3); color: transparent; border-radius: 3px; cursor: pointer; }
.f-sp:hover { color: inherit; background: none; }
.modal.tg-soon { width: min(460px, calc(100vw - 24px)); top: 14vh; }
.tg-soon-grid { display: flex; gap: 14px; align-items: center; }
.tg-soon-grid ol { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; color: var(--muted); }
.qr-mock { width: 96px; height: 96px; flex: none; border-radius: 10px; border: 1px dashed var(--line-3); display: grid; place-items: center; color: var(--faint); background: var(--bg); }
.qr-mock .ic { width: 56px; height: 56px; }
.tg-soon-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.tg-soon-list div { display: flex; align-items: center; gap: 6px; }
@media (max-width: 520px) { .tg-soon-list { grid-template-columns: 1fr; } .tg-soon-grid { flex-direction: column; align-items: flex-start; } }
.hintbox.approval { background: var(--blue-bg); border-color: var(--blue-line); width: 100%; }
.approval-text { width: 100%; white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.45; padding: 8px 10px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); }
textarea.approval-text { font: inherit; resize: vertical; }

/* ---------- 0.8.6: календарь ---------- */
.k-call { --k: var(--blue); }
.k-meet { --k: var(--violet); }
.k-event { --k: var(--t-teal); }
.k-pause { --k: var(--orange); }
.k-kt { --k: var(--gold); }
.k-dl { --k: var(--red); }
.k-task { --k: var(--navy); }
.k-bday { --k: var(--t-pink); }
.k-hol { --k: var(--green); }
.cal-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--k, var(--faint)); flex: none; }
.cal-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.cal-title { font-size: 16px; margin-left: 6px; }
.cal-filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-filters .chip.layer { gap: 6px; }
.cal-filters .cal-staff { width: auto; max-width: 220px; }
.cal-filters .chip.layer:not(.on) { opacity: 0.55; }
.cal-filters .chip.layer.on { background: var(--panel); color: var(--text); border-color: var(--line-3); }
.cal-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.cal-agenda { display: flex; flex-direction: column; gap: 14px; }
.cal-day-h { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; color: var(--muted); margin-bottom: 6px; text-transform: none; }
.cal-day-h .n { font-size: 11px; color: var(--faint); font-weight: 500; }
.cal-day.today .cal-day-h { color: var(--blue); }
.cal-it { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line-2); }
.cal-it:last-child { border-bottom: 0; }
.cal-time { width: 44px; flex: none; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); }
.cal-main { flex: 1; min-width: 0; }
.cal-t { font-size: 13.5px; overflow-wrap: anywhere; }
.cal-s { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 2px; }
.cal-s .linkbtn { border: 0; background: none; padding: 0; color: var(--blue); font-size: 12px; cursor: pointer; }
.cal-acts { display: flex; gap: 6px; flex: none; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--line); gap: 1px; }
.cal-wd { background: var(--panel-2); text-align: center; font-size: 11.5px; color: var(--muted); padding: 5px 0; }
.cal-cell { background: var(--panel); min-height: 96px; padding: 4px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-grid.week .cal-cell { min-height: 320px; }
.cal-cell.out { background: var(--bg); }
.cal-cell.out .cal-cell-h { color: var(--faint); }
.cal-cell-h { font-size: 12px; color: var(--muted); padding: 2px 4px; }
.cal-cell.today .cal-cell-h b { background: var(--blue); color: var(--on-solid); border-radius: 10px; padding: 0 6px; }
.cal-cell-it { border: 0; background: none; padding: 0; text-align: left; width: 100%; cursor: pointer; border-radius: 5px; }
.cal-cell-it:hover { background: var(--hover); }
.cal-it.compact { padding: 2px 4px; gap: 5px; border: 0; }
.cal-it.compact .cal-t { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chatpick { position: relative; }
.chatpick-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: var(--panel); border: 1px solid var(--line-3); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); max-height: 260px; overflow: auto; }
.chatpick-list .lrow { display: flex; flex-direction: column; align-items: flex-start; width: 100%; border: 0; background: none; text-align: left; padding: 7px 10px; cursor: pointer; }
.chatpick-list .lrow:hover { background: var(--hover); }
.chat-calls .cal-row.past { opacity: 0.6; }
.chat-calls .cal-row { gap: 8px; }
@media (max-width: 760px) {
  .cal-grid.month .cal-cell { min-height: 64px; }
  .cal-grid.week { grid-template-columns: 1fr; }
  .cal-grid.week .cal-cell { min-height: 0; }
  .cal-it { flex-wrap: wrap; }
  .cal-acts { width: 100%; justify-content: flex-end; }
}
.cal-top .tbl-mode { border-right: 0; padding: 0; }
.cal-top .tbl-mode button:first-child { border-radius: 7px 0 0 7px; }
.cal-top .tbl-mode button:last-child { border-radius: 0 7px 7px 0; }
.cal-top .tbl-mode button.on { background: var(--navy); color: var(--on-accent); border-color: var(--navy); }
@media (max-width: 700px) {
  .cal-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -16px; padding-right: 16px; }
  .cal-filters::-webkit-scrollbar { display: none; }
  .cal-filters > * { flex: 0 0 auto; }
}

/* ---------- 0.8.7: подпункты меню, вкладки настроек ---------- */
/* Меню растет вниз (подпункты внутри) - сначала сжимается место кота, потом меню прокручивается само. */
.nav { flex: 0 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
.side-foot, .side-credit, .brand { flex: none; }
.nav-i { position: relative; display: flex; flex-direction: column; flex: none; }
.nav-i > a { padding-right: 36px; }
.nav-arr { position: absolute; right: 4px; top: 5px; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px; background: none;
  color: var(--side-dim); opacity: 0.6; display: grid; place-items: center; cursor: pointer; }
.nav-arr .ic { width: 14px; height: 14px; transition: transform 0.15s; }
.nav-i:hover .nav-arr, .nav-arr:focus-visible, .nav-i.open .nav-arr { opacity: 1; }
.nav-arr:hover { background: var(--side-hover); color: var(--side-fg); }
.nav-arr:focus-visible { outline: 2px solid var(--side-fg); outline-offset: -2px; }
.nav.inline-mode .nav-i.open .nav-arr .ic { transform: rotate(90deg); }
.nav-i > a .badge { margin-right: 2px; }
.nav-sub { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 6px 22px; }
.nav-sub .sub-a { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--ctl); color: var(--side-dim); font-size: 13px; text-decoration: none; min-width: 0; }
.nav-sub .sub-a:hover { background: var(--side-hover); color: var(--side-fg); }
.nav-sub .sub-a.on { background: var(--side-hover); color: var(--side-fg); font-weight: 600; }
.nav-sub .sub-a .ic { width: 14px; height: 14px; flex: none; opacity: 0.8; }
.nav-sub .sub-h { font-size: 11.5px; color: var(--side-dim); opacity: 0.7; padding: 6px 10px 2px; display: flex; align-items: center; gap: 6px; }
.sub-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-t small { display: block; font-size: 11px; opacity: 0.7; overflow: hidden; text-overflow: ellipsis; }
.sub-n { margin-left: auto; font-size: 11.5px; opacity: 0.75; font-variant-numeric: tabular-nums; }
.sub-n.hot { color: #eda100; opacity: 1; font-weight: 700; }
/* Окошко с подпунктами - справа от меню (при меню сверху - под пунктом). */
.nav-fly { position: fixed; z-index: 60; min-width: 220px; max-width: 300px; max-height: calc(100vh - 16px); overflow: auto; padding: 6px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); font-size: 13.5px; }
.nav-fly.measuring { visibility: hidden; top: 0; left: 0; }
.nav-fly.wide { max-width: 540px; }
.nav-fly.wide .fly-list { columns: 2 220px; column-gap: 6px; }
.nav-fly .fly-h { padding: 6px 10px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.nav-fly .fly-h a { color: var(--text); font-weight: 700; text-decoration: none; }
.nav-fly .fly-h a:hover { color: var(--blue); }
.nav-fly .sub-a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 7px; color: var(--text); text-decoration: none; break-inside: avoid; }
.nav-fly .sub-a:hover { background: var(--line-2); }
.nav-fly .sub-a.on { background: var(--sel, var(--line-2)); font-weight: 600; }
.nav-fly .sub-a .ic { width: 15px; height: 15px; color: var(--muted); flex: none; }
.nav-fly .sub-n { color: var(--muted); opacity: 1; }
.nav-fly .sub-n.hot { color: var(--gold, #b07a00); }
.nav-fly .sub-h { display: flex; align-items: center; gap: 6px; padding: 8px 10px 3px; font-size: 12px; font-weight: 600; color: var(--muted); break-after: avoid; }
.nav-fly .sub-h .ic { width: 14px; height: 14px; }
.nav-fly .tag { font-size: 10.5px; }
/* Свернутое меню: стрелок нет, подпункты - наведением. */
:root:not([data-theme='mono']) .app.side-mini .nav-arr { display: none; }
:root:not([data-theme='mono']) .app.side-mini .nav-i > a { padding-right: 0; }
/* Меню сверху ("Строгая"): стрелка вниз рядом с названием, подпункты под пунктом. */
@media (min-width: 861px) {
  [data-theme='mono'] .nav { overflow: visible; flex: 1; }
  [data-theme='mono'] .nav-i { flex-direction: row; }
  [data-theme='mono'] .nav-i > a { padding-right: 24px; }
  [data-theme='mono'] .nav-arr { top: 50%; right: 2px; width: 20px; height: 20px; transform: translateY(-50%); color: inherit; }
  [data-theme='mono'] .nav-arr .ic { transform: rotate(90deg); }
}
/* Кот спрятался: место есть только для ушей. */
/* Кот всегда хоть немного виден: меню скорее прокрутится, чем закроет его совсем. */
.cat-zone { min-height: 16px; flex-shrink: 0; flex-basis: 16px; flex-grow: 1; }
[data-theme='mono'] .cat-zone { min-height: 0; }
.cat-zone.peek { align-items: flex-start; }
.cat-zone.peek .cat-say { display: none; }
/* Настройки: вкладки разделов и короткие списки. */
.chips.tabs.set-tabs { margin-bottom: 18px; }
.set-tabs .chip { text-decoration: none; }
.set-tabs .chip .ic { width: 13px; height: 13px; opacity: 0.6; }
.more-btn { margin-top: 2px; align-self: flex-start; }
.sm-search { flex: 0 1 280px; }
.menu-mode { align-self: flex-start; padding: 0; border-right: 0; }
/* Кнопка-ссылка ("еще 3", "Показать все", "Свернуть"): без рамки, цветом ссылки. */
.linkbtn { border: 0; background: none; padding: 0; font: inherit; color: var(--blue); cursor: pointer; text-align: left; }
.linkbtn:hover { text-decoration: underline; }
.linkbtn.small { font-size: 12.5px; }
.linkbtn.faint { color: var(--muted); }
.cal-cell .linkbtn { padding: 2px 4px; font-size: 12px; }
@media (max-width: 860px) {
  .chips.tabs.set-tabs { margin: 0 -12px 14px; padding: 0 12px 2px; }
}
/* Неудачные входы: кто, откуда, почему. */
.fails-bar { flex-direction: column; align-items: stretch; gap: 8px; }
.fails-tbl { background: var(--panel); border-radius: 8px; }
.fails-tbl td { vertical-align: top; }
.fails-tbl b { display: inline; margin: 0; }
/* Настройки - Активность: кто в CRM сейчас, по дням, один человек. */
.pdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--line-3); vertical-align: 0; }
.pdot.work { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.pdot.idle { background: var(--gold); }
.pdot.away { background: transparent; border: 2px solid var(--faint); width: 9px; height: 9px; box-sizing: border-box; }
.pdot.off { background: var(--line-3); }
.act-h { padding: 12px 14px 8px; gap: 10px; }
.act-list { display: flex; flex-direction: column; }
.act-p { display: flex; align-items: flex-start; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--line-2); }
.act-p .pdot { margin-top: 5px; }
.act-p.off { opacity: 0.85; }
.act-main { flex: 1; min-width: 0; }
.act-name { font-weight: 600; color: var(--text); text-decoration: none; }
.act-name:hover { text-decoration: underline; }
.act-where { margin-top: 2px; overflow-wrap: anywhere; }
.act-side { text-align: right; flex: none; max-width: 46%; }
.act-sub { padding: 10px 14px 4px; font-weight: 600; }
.act-absent { padding: 10px 14px 12px; border-top: 1px solid var(--line-2); line-height: 1.6; }
.act-absent .ic { width: 13px; height: 13px; vertical-align: -2px; }
.act-absent a { color: var(--text); }
.act-late, a.act-late { color: var(--orange); }
.act-off { color: var(--orange); }
.act-tbl td.num, .act-tbl th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.act-tbl td a { color: var(--text); text-decoration: none; }
.act-tbl td a:hover { text-decoration: underline; }
.act-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; color: var(--blue); text-decoration: none; }
.act-title { font-size: 17px; }
.act-acts { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); margin-top: 4px; }
.act-acts span { white-space: nowrap; }
/* Полоса суток: фон - рабочие часы, столбики - работа по четвертям часа, черта - сейчас. */
.strip { position: relative; height: 18px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.strip .sh { position: absolute; top: 0; bottom: 0; background: var(--blue-line); opacity: 0.75; }
.strip b { position: absolute; top: 2px; bottom: 2px; width: calc(100% / 96); background: var(--green); border-radius: 1px; }
.strip u { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--red); text-decoration: none; }
.strip-ax { display: flex; justify-content: space-between; font-size: 11px; font-variant-numeric: tabular-nums; }
.act-day { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 9px 14px; border-top: 1px solid var(--line-2); align-items: start; }
.act-day.ax { border-top: 0; padding-top: 0; padding-bottom: 2px; }
.act-day.free { align-items: center; padding-top: 6px; padding-bottom: 6px; }
.act-dl { font-size: 13px; font-weight: 600; padding-top: 1px; }
.act-day.free .act-dl, .act-day.none .act-dl { color: var(--muted); font-weight: 500; }
.act-ds { gap: 4px 12px; margin-top: 5px; }
.act-more { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.act-more .act-sub { padding: 6px 0 2px; }
.act-vis td { padding: 5px 10px 5px 0; border-bottom: 1px solid var(--line-2); }
.act-top { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.act-top a { color: var(--text); }
/* Разделы: доля времени. */
.act-views { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.vbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--line-2); }
.vbar i, .vleg i { display: block; height: 100%; }
.vleg { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.vleg span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.vleg i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.v-dashboard { background: var(--navy-3); }
.v-chats { background: var(--blue); }
.v-tasks { background: var(--violet); }
.v-calendar { background: var(--t-teal); }
.v-tables { background: var(--green); }
.v-templates { background: var(--gold); }
.v-bot { background: var(--t-pink); }
.v-staff { background: var(--orange); }
.v-settings { background: var(--faint); }
.v-help { background: var(--t-rust); }
.v-more { background: var(--line-3); }
.v-analytics { background: var(--t-blue); }
@media (max-width: 860px) {
  .act-p { flex-wrap: wrap; }
  .act-side { text-align: left; max-width: none; flex-basis: 100%; padding-left: 19px; }
  .act-day { grid-template-columns: 1fr; gap: 4px; }
}
/* Аналитика: вкладки, карточки сотрудника, столбики по неделям, движение клиентов, нагрузка. */
.set-tabs .chip .ic { width: 13px; height: 13px; }
.an-head { display: flex; flex-direction: column; gap: 10px; }
.input.an-pick { width: auto; min-width: 220px; max-width: 100%; }
.an-who .pdot { vertical-align: 0; margin-right: 2px; }
.an-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.an-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.an-card.wide { grid-column: 1 / -1; }
.an-ch { font-weight: 600; }
.an-ch .small { font-weight: 400; margin-left: 4px; }
.an-sub { margin-top: 2px; }
.an-bigs { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.an-big { display: flex; flex-direction: column; min-width: 64px; color: var(--text); text-decoration: none; }
.an-big b { font-size: 22px; line-height: 1.15; font-weight: 650; font-variant-numeric: tabular-nums; }
.an-big span { font-size: 12px; color: var(--muted); }
a.an-big:hover b { text-decoration: underline; }
.an-big.warn b { color: var(--orange); }
.an-big.bad b { color: var(--red); }
.an-segs { display: flex; flex-wrap: wrap; gap: 6px; }
.an-segs .chip { font-size: 12.5px; }
.an-bars { display: flex; align-items: flex-end; gap: 6px; height: 92px; }
.an-bar { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 2px; }
.an-bar i { display: block; width: 100%; max-width: 30px; background: var(--blue); border-radius: 3px 3px 0 0; opacity: 0.8; }
.an-bar i.none { background: var(--line-2); opacity: 1; }
.an-bar small { font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.an-bv { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 14px; }
.an-flow td, .an-flow th { white-space: nowrap; }
.an-flow td.num .linkbtn { font-variant-numeric: tabular-nums; font-weight: 600; }
.an-flow td.num .linkbtn.on { background: var(--sel); border-radius: 4px; padding: 0 4px; }
.an-load tr.an-group td { background: var(--panel-2); font-size: 12px; font-weight: 600; color: var(--muted); padding-top: 6px; padding-bottom: 6px; }
.an-heat { display: inline-block; min-width: 28px; padding: 1px 6px; border-radius: 4px; text-align: right; background: rgba(47, 111, 178, calc(var(--h) * 0.28)); }
.an-weeks { display: flex; flex-direction: column; gap: 6px; }
.an-wk { display: grid; grid-template-columns: 64px 1fr 170px; gap: 10px; align-items: center; }
.an-wk .vbar { height: 14px; }
.vbar.an-mini { height: 8px; max-width: 360px; }
.vbar.none { background: transparent; }
@media (max-width: 860px) {
  .an-grid { grid-template-columns: 1fr; }
  .an-wk { grid-template-columns: 52px 1fr; }
  .an-wk > span:last-child { grid-column: 2; }
  .input.an-pick { min-width: 0; width: 100%; }
}

/* ---------- ИИ-анализ чатов: окно как в Telegram ---------- */
.view.view-fill { overflow: hidden; display: flex; }
.tg {
  --tg-accent: #3390ec; --tg-text: #0f1419; --tg-sec: #707579; --tg-meta: #a1aab3; --tg-panel: #fff; --tg-hover: #f4f4f5; --tg-line: #e4e6ea;
  --tg-in: #fff; --tg-out: #eeffde; --tg-out-meta: #4fae4e; --tg-sel: #3390ec; --tg-sel-fg: #fff; --tg-pill: rgba(23, 45, 25, 0.3);
  --tg-wall: linear-gradient(135deg, #d7e3b6 0%, #a9cf9e 32%, #c7d89b 64%, #94c08f 100%);
  --tg-dots: rgba(30, 70, 30, 0.07);
  flex: 1; min-width: 0; display: flex; height: 100%; background: var(--tg-panel); color: var(--tg-text);
}
:root[data-theme='dark'] .tg {
  --tg-accent: #5eb5f7; --tg-text: #f5f5f5; --tg-sec: #7f91a4; --tg-meta: #6d8193; --tg-panel: #17212b; --tg-hover: #202b36; --tg-line: #0f1923;
  --tg-in: #182533; --tg-out: #2b5278; --tg-out-meta: #7eb5e6; --tg-sel: #2b5278; --tg-sel-fg: #fff; --tg-pill: rgba(0, 0, 0, 0.35);
  --tg-wall: #0e1621; --tg-dots: rgba(255, 255, 255, 0.025);
}
.tg a { color: inherit; }
.tg-side { width: 340px; flex: none; display: flex; flex-direction: column; border-right: 1px solid var(--tg-line); background: var(--tg-panel); min-height: 0; }
.tg-side-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px 6px; }
.tg-search { flex: 1; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 20px; background: var(--tg-hover); color: var(--tg-sec); border: 2px solid transparent; }
.tg-search:focus-within { border-color: var(--tg-accent); background: var(--tg-panel); color: var(--tg-accent); }
.tg-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--tg-text); font: inherit; font-size: 14.5px; }
.tg-search.wide { flex: none; }
.tg-round { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--tg-sec); text-decoration: none; }
.tg-round:hover { background: var(--tg-hover); color: var(--tg-accent); }
.tg-side-links { display: flex; gap: 14px; padding: 2px 18px 8px; }
.tg-side-links a { color: var(--tg-accent); text-decoration: none; font-weight: 500; }
.tg-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--tg-accent); color: #fff; font-size: 11px; font-weight: 700; }
.tg-rows { flex: 1; overflow-y: auto; padding: 0 6px 10px; }
.tg-row { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 12px; text-decoration: none; color: var(--tg-text); width: 100%; border: 0; background: none; text-align: left; font: inherit; cursor: pointer; }
.tg-row:hover { background: var(--tg-hover); }
.tg-row.on { background: var(--tg-sel); color: var(--tg-sel-fg); }
.tg-row.on .tg-row-s, .tg-row.on .tg-row-time, .tg-row.on .tg-you, .tg-row.on .tg-tag { color: inherit; opacity: 0.9; }
.tg-row.on .tg-tag { background: rgba(255, 255, 255, 0.2); }
.tg-row-m { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tg-row-t { display: flex; gap: 8px; align-items: baseline; }
.tg-row-t b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 15px; }
.tg-row-time { font-size: 12px; color: var(--tg-sec); flex: none; }
.tg-row-s { color: var(--tg-sec); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-you { color: var(--tg-accent); }
.tg-row-tags { display: flex; gap: 4px; overflow: hidden; margin-top: 2px; }
.tg-row-tags:empty { display: none; }
.tg-tag { font-size: 11px; padding: 0 7px; border-radius: 9px; background: var(--tg-hover); color: var(--tg-sec); white-space: nowrap; line-height: 18px; }
.tg-tag.ok { color: var(--green); background: var(--green-bg); }
.tg-empty { padding: 30px 16px; text-align: center; color: var(--tg-sec); }
.tg-av { flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; text-transform: uppercase; user-select: none; }
.tg-av.md { width: 54px; height: 54px; font-size: 19px; }
.tg-av.sm { width: 42px; height: 42px; font-size: 15px; }
.tg-av.lg { width: 84px; height: 84px; font-size: 30px; }
.tg-av.tg-ai { background: linear-gradient(135deg, #6ec3f4, #3390ec 55%, #8774e1); }
.tg-av.tg-ai .ic { width: 55%; height: 55%; }
.tg-typing-s { color: var(--tg-accent); }
.tg-typing-s i, .tg-dots i { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: currentColor; margin-left: 2px; vertical-align: middle; animation: tg-dot 1.2s infinite ease-in-out; }
.tg-typing-s i:nth-child(2), .tg-dots i:nth-child(2) { animation-delay: 0.15s; }
.tg-typing-s i:nth-child(3), .tg-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes tg-dot { 0%, 60%, 100% { opacity: 0.25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }
.tg-err-s { color: #e53935; }
:root[data-theme='dark'] .tg-err-s { color: #f0716f; }

.tg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; background: var(--tg-wall); }
.tg-main::before { content: ''; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(var(--tg-dots) 1.5px, transparent 1.6px), radial-gradient(var(--tg-dots) 1px, transparent 1.1px); background-size: 34px 34px, 22px 22px; background-position: 0 0, 11px 17px; }
.tg-main > * { position: relative; }
.tg-head { display: flex; align-items: center; gap: 12px; padding: 8px 16px; min-height: 56px; background: var(--tg-panel); border-bottom: 1px solid var(--tg-line); flex: none; }
.tg-head-m { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tg-head-m b { font-size: 15.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-head-m .small { color: var(--tg-sec); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-back { display: none; width: 40px; height: 40px; border-radius: 50%; place-items: center; color: var(--tg-sec); flex: none; margin-left: -8px; }
.tg-hbtn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 18px; border: 0; background: none; color: var(--tg-sec); font: inherit; font-weight: 500; cursor: pointer; flex: none; }
.tg-hbtn:hover, .tg-hbtn.on { background: var(--tg-hover); color: var(--tg-accent); }
.tg-hbtn.icon { width: 36px; padding: 0; justify-content: center; }
.tg-hbtn.danger { color: #e53935; background: rgba(229, 57, 53, 0.1); }
.tg-body { flex: 1; min-height: 0; display: flex; }
.tg-msgs { flex: 1; min-width: 0; overflow-y: auto; padding: 12px max(16px, calc((100% - 780px) / 2)) 18px; display: flex; flex-direction: column; }
.tg-sys { text-align: center; margin: 10px 0 6px; }
.tg-sys span { display: inline-block; max-width: 85%; padding: 3px 11px; border-radius: 13px; background: var(--tg-pill); color: #fff; font-size: 13px; font-weight: 500; line-height: 1.45; }
.tg-sys.tg-cost span { font-size: 12px; font-weight: 400; opacity: 0.9; }
.tg-m { display: flex; margin: 3px 0; }
.tg-m.out { justify-content: flex-end; }
.tg-b { position: relative; max-width: min(620px, 82%); padding: 6px 10px 5px 11px; border-radius: 13px; font-size: 15px; line-height: 1.42; box-shadow: 0 1px 2px rgba(16, 35, 47, 0.15); word-break: break-word; }
.tg-b.in { background: var(--tg-in); border-bottom-left-radius: 4px; margin-left: 8px; }
.tg-b.out { background: var(--tg-out); border-bottom-right-radius: 4px; margin-right: 8px; }
.tg-b.in::before, .tg-b.out::before { content: ''; position: absolute; bottom: 0; width: 10px; height: 17px; background: inherit; }
.tg-b.in::before { left: -9px; -webkit-mask: radial-gradient(10px 17px at 0 0, transparent 99%, #000 100%); mask: radial-gradient(10px 17px at 0 0, transparent 99%, #000 100%); }
.tg-b.out::before { right: -9px; -webkit-mask: radial-gradient(10px 17px at 100% 0, transparent 99%, #000 100%); mask: radial-gradient(10px 17px at 100% 0, transparent 99%, #000 100%); }
.tg-author { font-size: 13.5px; font-weight: 600; color: #e17076; margin-bottom: 2px; }
.tg-author.tg-ai { color: var(--tg-accent); }
.tg-text { white-space: pre-wrap; }
.tg-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 1px; }
.tg-time { font-size: 12px; color: var(--tg-meta); white-space: nowrap; }
.tg-b.out .tg-time, .tg-ticks { color: var(--tg-out-meta); }
.tg-link { border: 0; background: none; padding: 0; font: inherit; color: var(--tg-accent); cursor: pointer; font-size: 12.5px; text-decoration: none; }
.tg-b .tg-link { opacity: 0; transition: opacity 0.15s; }
.tg-b:hover .tg-link, .tg-b.err .tg-link { opacity: 1; }
.tg-b.typing { display: flex; align-items: center; gap: 8px; color: var(--tg-accent); padding: 10px 14px; }
.tg-typing-t { font-size: 14px; }
.tg-b.err { border: 1px solid #f0b8b8; }
.tg-err-act { display: flex; justify-content: space-between; gap: 12px; margin-top: 4px; }
.tg-md p { margin: 0 0 6px; }
.tg-md p:last-child, .tg-md ul:last-child, .tg-md ol:last-child { margin-bottom: 0; }
.tg-md ul, .tg-md ol { margin: 2px 0 7px; padding-left: 22px; }
.tg-md li { margin: 2px 0; }
.tg-md .tg-h { font-weight: 700; margin: 8px 0 4px; }
.tg-md .tg-h:first-child { margin-top: 0; }
.tg-md .tg-h.h1, .tg-md .tg-h.h2 { font-size: 16px; }
.tg-md blockquote { margin: 4px 0 7px; padding: 2px 0 2px 9px; border-left: 3px solid var(--tg-accent); color: inherit; opacity: 0.9; }
.tg-md code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; padding: 1px 4px; border-radius: 4px; background: var(--tg-hover); }
.tg-md hr { border: 0; border-top: 1px solid var(--tg-line); margin: 8px 0; }
.tg-q { color: inherit; }

.tg-compose { flex: none; display: flex; align-items: flex-end; gap: 8px; padding: 8px max(16px, calc((100% - 780px) / 2)) 14px; }
.tg-compose textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: 0; border-radius: 22px; padding: 11px 16px; background: var(--tg-panel); color: var(--tg-text); font: inherit; font-size: 15px; line-height: 1.4; max-height: 180px; box-shadow: 0 1px 2px rgba(16, 35, 47, 0.15); }
.tg-compose textarea::placeholder { color: var(--tg-meta); }
.tg-model { flex: none; height: 44px; border: 0; border-radius: 22px; padding: 0 12px; background: var(--tg-panel); color: var(--tg-accent); font: inherit; font-weight: 600; font-size: 13px; box-shadow: 0 1px 2px rgba(16, 35, 47, 0.15); cursor: pointer; }
.tg-send { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--tg-accent); color: #fff; cursor: pointer; box-shadow: 0 1px 2px rgba(16, 35, 47, 0.2); }
.tg-send:disabled { background: var(--tg-panel); color: var(--tg-meta); cursor: default; }
.tg-send .ic { width: 22px; height: 22px; }

.tg-chat { width: 400px; flex: none; display: flex; flex-direction: column; background: var(--bg); border-left: 1px solid var(--tg-line); min-height: 0; }
.tg-chat-h { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 16px; background: var(--tg-panel); border-bottom: 1px solid var(--tg-line); min-height: 48px; }
.tg-chat-h b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-chat-feed { flex: 1; min-height: 0; display: flex; flex-direction: column; color: var(--text); }
.tg-center { margin: auto; text-align: center; color: var(--tg-sec); padding: 30px; }

.tg-intro .tg-center { color: inherit; }
.tg-intro-card { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 360px; padding: 26px 24px; border-radius: 18px; background: var(--tg-pill); color: #fff; }
.tg-intro-card b { font-size: 17px; }
.tg-intro-card .small { opacity: 0.92; line-height: 1.45; }
.tg-intro-card .btn { margin-top: 6px; background: var(--tg-accent); border-color: var(--tg-accent); color: #fff; border-radius: 18px; }
/* Переписка клиента рядом с разбором - тоже как в Telegram. */
.tg-chat { background: var(--tg-wall); }
.tg-chat .bubble { border: 0; border-radius: 13px; background: var(--tg-in); box-shadow: 0 1px 2px rgba(16, 35, 47, 0.15); }
.tg-chat .msg.out .bubble { background: var(--tg-out); }
.tg-chat .msg.note .bubble { background: var(--note); }
.tg-chat .day span { background: var(--tg-pill); color: #fff; border-radius: 12px; padding: 3px 10px; font-weight: 500; }

.tg-new-wrap { background: var(--bg); }
.tg-new-wrap::before { display: none; }
.tg-new { flex: 1; overflow-y: auto; padding: 16px max(16px, calc((100% - 720px) / 2)) 30px; display: flex; flex-direction: column; gap: 12px; color: var(--text); }
.tg-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.tg-dev { display: inline-block; padding: 1px 8px; border-radius: 9px; background: var(--gold-bg); color: var(--warn-text); font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; }
.tg-intro-card .tg-dev { background: rgba(255, 255, 255, 0.92); color: #7a5200; }
.tg-intro-card .small a { color: #fff; text-decoration: underline; }
.tg-ok { display: inline-block; padding: 1px 8px; border-radius: 9px; background: var(--green-bg); color: var(--green); font-size: 11.5px; font-weight: 700; margin-right: 4px; }
.tg-keyform { display: flex; gap: 8px; flex-wrap: wrap; }
.tg-keyform .input { flex: 1; min-width: 220px; font-family: ui-monospace, Menlo, monospace; }
.tg-card code { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; padding: 1px 5px; border-radius: 4px; background: var(--bg); }
.tg-warn a { color: inherit; font-weight: 600; }
.tg-warn { padding: 10px 14px; border-radius: 12px; background: var(--tint-warn); border: 1px solid var(--warn-line); color: var(--warn-text); }
.tg-seg { display: flex; padding: 3px; border-radius: 12px; background: var(--bg); gap: 3px; }
.tg-seg button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; border: 0; border-radius: 9px; background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.tg-seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(18, 35, 58, 0.12); }
.tg-new .tg-search { background: var(--bg); color: var(--muted); }
.tg-new .tg-search input { color: var(--text); }
.tg-new .tg-row { color: var(--text); }
.tg-new .tg-row:hover { background: var(--hover); }
.tg-new .tg-row-s, .tg-new .tg-row-time { color: var(--muted); }
.tg-pick { display: flex; flex-direction: column; gap: 6px; }
.tg-pick-list { max-height: 264px; overflow-y: auto; margin: 0 -6px; }
.tg-picked { display: flex; align-items: center; gap: 10px; padding: 6px 2px; }
.tg-picked .tg-pk { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tg-picked small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tg-range label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.tg-range select.input { min-width: 260px; width: auto; flex: 1; max-width: 420px; }
.tg-range input.input[type='date'] { width: 150px; flex: none; }
.tg-est { padding: 8px 12px; border-radius: 10px; background: var(--bg); }
.tg-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.tg-presets .chip.add { border-style: dashed; }
.tg-addp { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 10px; background: var(--bg); }
.tg-addp .row { gap: 8px; }
textarea.input.tg-prompt, .tg-addp textarea.input, .tg-card textarea.input { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.45; resize: vertical; }
.tg-models { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tg-mod { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; position: relative; }
.tg-mod input { margin-top: 3px; }
.tg-mod > span:first-of-type { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.tg-mod small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.tg-mod.on { border-color: var(--tg-accent); box-shadow: 0 0 0 1px var(--tg-accent) inset; }
.tg-price { font-weight: 700; font-size: 13px; white-space: nowrap; }
.tg-go { display: flex; justify-content: flex-end; }
.tg-go .btn { height: 44px; padding: 0 22px; border-radius: 22px; background: var(--tg-accent); border-color: var(--tg-accent); color: #fff; }
.tg-go .btn:disabled { opacity: 0.5; }
.tg-preset { padding: 10px 0; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 6px; }
.tg-preset:first-of-type { border-top: 0; padding-top: 2px; }
.tg-preset.isnew { background: var(--tint-warn); margin: 0 -16px; padding: 10px 16px; }
.tg-preset.hid { opacity: 0.6; }
.tg-preset .tg-tag { background: var(--bg); color: var(--muted); }
.tg-ptext { white-space: pre-wrap; }
.ai-btn .ic { color: var(--blue); }
.v-ai { background: #3390ec; }

@media (max-width: 1180px) {
  .tg-chat { position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%); z-index: 3; box-shadow: var(--shadow-pop); }
  .tg-body { position: relative; }
}
@media (max-width: 960px) {
  .tg-side { width: 300px; }
  .tg-models { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .tg-side { width: 100%; border-right: 0; }
  .tg.has-main .tg-side { display: none; }
  .tg:not(.has-main) .tg-main { display: none; }
  .tg-back { display: grid; }
  .tg-head { padding: 6px 10px; padding-top: max(6px, env(safe-area-inset-top)); }
  .tg-hbtn span:not(.tg-sure) { display: none; }
  .tg-hbtn:not(.danger) { width: 40px; padding: 0; justify-content: center; }
  .tg-b { max-width: 88%; font-size: 15.5px; }
  .tg-msgs { padding: 10px 8px 14px; }
  .tg-compose { padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); gap: 6px; }
  .tg-compose textarea { font-size: 16px; }
  .tg-model { padding: 0 8px; max-width: 86px; }
  .tg-search input { font-size: 16px; }
  .tg-chat { width: 100%; }
  .tg-range select.input { min-width: 0; width: 100%; }
  .app.ai-deep .topbar, .app.ai-deep .tabbar { display: none; }
  .app.ai-deep .main { padding-bottom: 0; }
  .app.ai-view .main { overflow: hidden; }
}

/* "Клиент обратился к вам" в Задачах: цитата клиента и действия. */
.mention-box { display: flex; flex-direction: column; gap: 8px; }
.mention-q { padding: 6px 10px; border-left: 3px solid var(--blue); background: var(--blue-bg); border-radius: 0 var(--ctl) var(--ctl) 0; white-space: pre-wrap; word-break: break-word; font-size: 13.5px; }
.mention-box .small .ic { color: var(--green); vertical-align: -2px; }
/* Взаимопомощь: просьба коллеги в "Задачах" - кто просит, ДДЛ, ТЗ со ссылками. */
.mutual-box { display: flex; flex-direction: column; gap: 8px; }
.mutual-tz { padding: 6px 10px; border-left: 3px solid var(--green); background: var(--panel-2); border-radius: 0 var(--ctl) var(--ctl) 0; white-space: pre-wrap; word-break: break-word; font-size: 13.5px; }
.mutual-tz.clip { max-height: 6.6em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.mutual-tz a { color: var(--blue); }
.mutual-box .small .ic { color: var(--green); vertical-align: -2px; }
/* Переход со Smart Start: что отправить, кнопки в полосе над перепиской. */
.brief-list { margin: 4px 0 0; padding-left: 18px; }
/* Регулярные задачи: выбор сотрудников и строка правила. */
.rule-row { align-items: flex-start; }
.rule-row .acts { display: flex; align-items: center; gap: 4px; }
.briefbar { flex-wrap: wrap; row-gap: 6px; }
.briefbar .waitbar-t { flex-basis: 100%; }
.briefbar .mutual-box { flex-direction: row; }

/* Клиент в чате: может ли писать (права участников, бот 2.8). */
.rights-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--sw-off); flex: none; }
.rights-dot.ok { background: var(--green); }
.rights-dot.bad { background: var(--red); }
.bell-ic.k-chat_lock { background: var(--orange-bg); color: var(--orange); }

/* 0.9.3: календарь одного клиента */
.lead-side h4 .h4-link { float: right; border: 0; background: none; padding: 0; color: var(--blue); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.cal-filters .cal-client { padding-right: 4px; max-width: 280px; }
.cal-filters .cal-client .chip-x { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; padding: 0; flex: none; }
.cal-filters .cal-client .chip-x:hover { background: rgba(255, 255, 255, 0.18); }
.cal-filters > .linkbtn { border: 0; background: none; padding: 0 4px; color: var(--blue); font-size: 13px; font-weight: 600; text-decoration: none; }
.cal-find { margin-bottom: 14px; }

/* 0.9.3: задачи по задачам или по клиентам, метка программы Start */
.tasks-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.tasks-bar .tbl-mode { padding: 0; border-right: 0; }
.tasks-bar .tasks-q { flex: 1 1 200px; max-width: 320px; }
.tag.prog-tag { background: var(--violet-bg); color: var(--violet); font-size: 11px; vertical-align: 1px; white-space: nowrap; }
.section-h .sec-link { border: 0; background: none; padding: 0; font: inherit; color: var(--text); cursor: pointer; text-align: left; min-height: 24px; }
.section-h .sec-link:hover { color: var(--blue); text-decoration: underline; }
.tasks-rest-h { margin: 24px 0 10px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--faint); }
@media (max-width: 720px) { .tasks-bar .tasks-q { max-width: none; } }

/* 0.9.3: части страницы и разделы карточки, которые человек сворачивает сам (CRM запоминает) */
.part { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--line); }
.part-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; margin: 4px 0 12px; padding: 4px 0; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.part-h.static { cursor: default; margin-top: 0; }
.part-h b { font-size: 16px; }
.part-h .part-sub { font-size: 12.5px; color: var(--muted); }
.part-h .part-tg { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--blue); }
.part-h > .ic:first-child { flex: none; color: var(--muted); transition: transform .15s; }
.part.open > .part-h > .ic:first-child { transform: rotate(90deg); }
.part-h:focus-visible, .sec-t:focus-visible, .more-f:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.lead-side h4.sec-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sec-h .sec-t { display: inline-flex; align-items: center; gap: 4px; margin-left: -3px; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; text-align: left; min-height: 24px; }
.sec-h .sec-t:hover { color: var(--text); }
.sec-h .sec-t > .ic { flex: none; opacity: .7; transition: transform .15s; }
.sec-h.open .sec-t > .ic { transform: rotate(90deg); }
.sec-h .sec-sum { min-width: 0; max-width: 62%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 500; color: var(--faint); }
.lead-side h4.sec-h .h4-link { float: none; margin-left: auto; }
@media (max-width: 720px) { .part-h .part-sub { flex-basis: 100%; order: 3; padding-left: 22px; } .part-h.static .part-sub { flex-basis: auto; order: 0; padding-left: 0; } .cal-filters .cal-staff { max-width: 150px; } }

/* 0.9.3: вкладка "Инструкции" и закрепленные документы */
.kb-pins { margin-bottom: 12px; }
.kb-pins h3 .n { font-weight: 500; color: var(--faint); }
.kb-ins-l { display: flex; flex-direction: column; }
.kb-ins-r { display: grid; grid-template-columns: minmax(0, 1fr) 72px 34px; gap: 10px; align-items: center; padding: 7px 2px; border-bottom: 1px solid var(--line-2); }
.kb-ins-r:last-child { border-bottom: 0; }
.kb-ins-r .kb-use { margin-top: 3px; }
.kb-ins .fold-b { padding: 0 14px 10px; }
.kb-pin { color: var(--faint); }
.kb-pin.on { color: var(--blue); }
.kb-pin.on .ic { fill: currentColor; }
.kb-ins-g { margin: 6px 0 12px; }
.kb-ins-gh { margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
@media (max-width: 720px) { .kb-ins-r { grid-template-columns: minmax(0, 1fr) 34px; } .kb-ins-d { display: none; } }
/* Меню: у Базы знаний подпункты */
.nav .nav-i.help-i { margin-top: 0; }
.nav .nav-i.help-i > a.nav-help { margin-top: 0; }
[data-theme='mono'] .nav .nav-i.help-i { margin: 0 0 0 auto; }
[data-theme='mono'] .nav .nav-i.help-i > a.nav-help { margin: 0; }
.cal-filters .cal-client .cal-client-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec-h .sec-sum.warn { color: var(--orange); font-weight: 600; }
.cal-filters > button.linkbtn { cursor: pointer; }

/* Обучающие видео (0.9.8) */
.videos .video-player { margin-bottom: 18px; }
.videos video { width: 100%; max-width: 960px; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; display: block; }
.video-list { display: grid; gap: 8px; max-width: 960px; margin-bottom: 14px; }
.video-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.video-item:hover { background: var(--hover); border-color: var(--line-3); }
.video-item.on { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy) inset; }
.video-ic { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: var(--on-accent); flex: none; }
.video-t { flex: 1; font-weight: 600; }

/* Календарь месяца в "Сотрудники" - "График" (0.9.9) */
.cal td.away, .cal-legend i.away { background: var(--violet-bg); color: var(--violet); }
.cal th.we { color: var(--faint); }
.cal th.now { color: var(--text); box-shadow: inset 0 -2px 0 var(--navy); }
.cal tr.cal-g td { background: none; text-align: left; font-weight: 700; color: var(--muted); padding: 8px 0 2px; height: auto; }
.cal-month .cal td.who { position: sticky; left: 0; background: var(--panel); z-index: 1; white-space: nowrap; }
.cal-month .cal thead th { position: sticky; top: 0; background: var(--panel); z-index: 2; }

/* Цвета из таблицы в виде "Список" (0.9.9.1): строка - полоска слева, ячейка - мягкая подложка, отбор - точки */
.bd-cc { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: var(--pill); background: color-mix(in srgb, var(--cc) 26%, var(--panel)); }
.bd-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 18%, transparent); }
.bd-colors { display: inline-flex; gap: 4px; align-items: center; }
.bd-color { display: inline-flex; align-items: center; gap: 2px; height: 28px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--pill); background: var(--panel); color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.bd-color:hover { border-color: var(--line-3); }
.bd-color.on { border-color: var(--rc); background: color-mix(in srgb, var(--rc) 16%, var(--panel)); color: var(--text); font-weight: 600; }
.rp-tr.hl > td { background: color-mix(in srgb, var(--navy) 7%, var(--panel)); }

/* Запрос руководителю в "Задачах" (0.9.9.1) */
.req-box .req-text { margin-top: 6px; white-space: pre-wrap; line-height: 1.5; }
.req-box .req-reply { margin-top: 6px; padding-left: 10px; border-left: 2px solid var(--line-3); }

.vid-btn { color: var(--muted); }
.vid-btn .ic { color: var(--navy); }

/* 0.9.9.2: метка "Переподача" */
.tag.refile-tag { background: var(--t-teal-bg); color: var(--t-teal); }
.refile-mark { gap: 6px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.refile-mark .linkbtn { border: 0; background: none; padding: 0; color: var(--blue); font-size: 12.5px; cursor: pointer; }

/* ---------- служебные чаты (0.9.9.3): Чаты - "Служебные", новости отдела ---------- */
.svc-list { padding: 14px 20px 6px; }
.svc-h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.svc-h b { font-size: 14.5px; }
.svc-crm-h { margin: 14px 20px 8px; }
.svc-crm-h b { font-size: 13.5px; color: var(--muted); }
.svc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.svc-card { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; box-shadow: var(--card-shadow); min-width: 0; }
.svc-card:hover { background: var(--hover); }
.svc-card.has-new { border-color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); }
.svc-ic { flex: none; width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--violet-bg); color: var(--violet); }
.svc-ic.news { background: var(--gold-bg); color: var(--gold); }
.svc-ic.sm { width: 30px; height: 30px; }
.svc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.svc-main .t { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-main .tags { display: flex; flex-wrap: wrap; gap: 4px; }
.svc-main .s { font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.svc-main .s b { color: var(--text); font-weight: 600; }
.svc-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.tag.news { background: var(--gold-bg); color: var(--gold); }
.svc-empty { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); max-width: 720px; }
.svc-empty > .ic { flex: none; width: 26px; height: 26px; color: var(--faint); }
.svc-empty b { color: var(--text); }
.chats-body.svc-open { overflow: hidden; display: flex; flex-direction: column; }
.svc-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.svc-top { display: flex; align-items: center; gap: 10px; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--panel); }
.svc-title { display: flex; flex-direction: column; min-width: 0; }
.svc-title b, .svc-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-feed { min-height: 0; }
.svc-feed .bubble { max-width: min(720px, 92%); }
.svc-media { display: flex; flex-wrap: wrap; gap: 6px; }
.svc-new { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; color: var(--gold); font-size: 12px; font-weight: 650; }
.svc-new::before, .svc-new::after { content: ''; flex: 1; border-top: 1px solid var(--gold); opacity: 0.5; }
.svc-foot { display: flex; align-items: center; gap: 6px; padding: 8px 20px; border-top: 1px solid var(--line); background: var(--panel); }
.modal.svc-set { width: min(460px, calc(100vw - 24px)); top: 14vh; }
.svc-opt { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.svc-opt b { display: block; font-size: 13.5px; }
.svc-opt small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.modal.svc-add { width: min(560px, calc(100vw - 24px)); top: 9vh; max-height: 82vh; }
.svc-add-list { overflow: auto; max-height: 56vh; border: 1px solid var(--line); border-radius: 10px; }
.svc-add-list .lrow { padding: 8px 12px; }
.svc-add-h { padding: 8px 12px 4px; font-size: 12.5px; font-weight: 650; color: var(--muted); background: var(--bg); border-bottom: 1px solid var(--line-2); }
.dnews { max-width: 760px; }
.dnews-h { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.dnews-h > .ic { flex: none; width: 26px; height: 26px; color: var(--gold); }
.news-post { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 14px; margin-bottom: 10px; }
.news-post.fresh { box-shadow: inset 3px 0 0 var(--gold); }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.news-text { white-space: pre-wrap; word-break: break-word; margin-top: 6px; line-height: 1.5; }
.news-post .svc-media { margin-top: 8px; }
.news-post.clamp .news-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-card { margin-bottom: 14px; }
.news-card .card-h { align-items: center; }
.news-card .card-h .ic { color: var(--gold); }
.news-list { display: grid; gap: 8px; padding: 0 14px 12px; }
.news-card .news-post { margin: 0; background: var(--bg); }
@media (max-width: 1100px) {
  .svc-list { padding: 10px 10px 4px; }
  .svc-cards { grid-template-columns: 1fr; }
  .svc-crm-h { margin: 12px 10px 6px; }
  .svc-top { padding: 8px 10px; gap: 8px; }
  .svc-foot { padding: 8px 10px; }
  .svc-feed .bubble { max-width: 94%; }
}

/* ---------- версия 0.9.9.4: стадии "Смена статуса (485)" и "Продление визы", подсказки, обход клиентов ---------- */
:root { --s-teal: #0f8b8d; --s-indigo: #3b5ba5; }
.c-aos { background: var(--s-teal); }
.c-extension { background: var(--s-indigo); }
.tag.seg-aos::before { background: var(--s-teal); }
.tag.seg-extension::before { background: var(--s-indigo); }
.tag.track-t { background: var(--line-2); color: var(--text); gap: 6px; }
.tag.track-t::before { content: ''; width: 8px; height: 8px; border-radius: 50%; flex: none; border: 2px solid var(--s-indigo); box-sizing: border-box; }
.tag.track-t.t485::before { border-color: var(--s-teal); }
.track-box .row { margin-top: 8px; gap: 6px; }
.track-box .rel-btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-note { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.track-note .spacer { flex: 1; }
/* Вопрос по карточке в задачах: кнопки ответа под текстом. */
.ask-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.ask-box .ask-q { flex: 1 1 100%; font-size: 12.5px; color: var(--muted); }
.ask-list { display: grid; gap: 8px; margin-top: 6px; }
.ask-list .ask-one { padding: 7px 9px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel-2); }
.ask-list .ask-one.ok { opacity: 0.6; }
.ask-list .ask-one b { font-size: 13px; }
.sweep-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 8px; }
.sweep-h .sweep-bar { flex: 1 1 140px; height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.sweep-h .sweep-bar i { display: block; height: 100%; background: var(--s-aqua); }
.sweep-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 10px 12px; margin-bottom: 10px; }
.sweep-card .sweep-people { display: grid; gap: 4px; margin-top: 8px; }
.sweep-card .sweep-person { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.sweep-card .sweep-person .sweep-bar { flex: 0 0 120px; height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.sweep-card .sweep-person .sweep-bar i { display: block; height: 100%; background: var(--s-aqua); }
.sweep-form { display: grid; gap: 10px; }
.sweep-form .chips { flex-wrap: wrap; }
.sweep-form .chip .n { margin-left: 4px; }
.sweep-h .late, .sweep-card .late { color: var(--red); font-weight: 600; }
.sweep-card.muted { opacity: 0.65; }
/* Окно кота (0.9.9.4): вкладки "Передать лапку" и "Рейтинг". */
.cat-tabs { flex: none; display: flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--line-2); }
.cat-tabs button { flex: 1; height: 26px; border: 0; border-radius: 6px; background: none; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.cat-tabs button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.cat-rate { flex: 1 1 auto; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.paw-mine { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.paw-stat { position: relative; display: flex; flex-direction: column; padding: 8px 10px 7px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line-2); overflow: hidden; }
.paw-stat.in { background: linear-gradient(135deg, var(--sel), var(--panel-2)); }
.paw-stat .paw-ic { position: absolute; right: 8px; top: 6px; font-size: 18px; opacity: 0.85; }
.paw-stat b { font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.paw-stat span { font-size: 12.5px; color: var(--text); }
.paw-stat small { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.cat-rating .paw-bar { flex: 0 0 54px; height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.cat-rating .paw-bar i { display: block; height: 100%; border-radius: 3px; background: var(--gold, #c99a2e); }
.cat-rating li.top1 .t { font-weight: 700; }
.cat-rating li.top1 { background: linear-gradient(90deg, rgba(201, 154, 46, 0.14), transparent 70%); }
.cat-rating li.me.top1 { background: var(--sel); }
.cat-spans { flex: none; display: flex; flex-wrap: wrap; gap: 6px; }
.cat-spans .chip { font-size: 12px; }
.cat-rating { list-style: none; margin: 0 -6px; padding: 0; overflow: auto; min-height: 0; }
.cat-rating li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 7px; font-size: 13px; }
.cat-rating li.me { background: var(--sel); }
.cat-rating .pl { flex: none; width: 22px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.cat-rating .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-rating b { flex: none; font-variant-numeric: tabular-nums; }
.cat-mine { flex: none; padding: 0 4px; }
/* plusOne (0.9.9.4): чат пары клиентов. */
:root { --s-plum: #a0457e; }
:root[data-theme='dark'] { --s-plum: #d07ab0; }
.c-plusone { background: var(--s-plum); }
.tag.seg-plusone::before { background: var(--s-plum); }
.plusone-box { display: grid; gap: 8px; }
.plusone-box .row { align-items: center; }
.po-members { display: grid; gap: 6px; }
.po-m { display: flex; gap: 8px; align-items: flex-start; }
.po-n { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: var(--on-solid, #fff); background: var(--s-plum); }
.po-c { min-width: 0; }
.po-c a, .po-c span { font-weight: 600; }
.po-step { display: flex; gap: 8px; align-items: flex-start; padding-top: 6px; border-top: 1px dashed var(--line-2); font-size: 13px; }
.po-step > .ic { flex: none; margin-top: 2px; color: var(--muted); }
.po-step.ok > .ic { color: var(--green); }
.po-step.wait > .ic { color: var(--warn-text); }
.po-ol { margin: 4px 0 6px; padding-left: 18px; }
.po-ol li { margin: 2px 0; }
.quality-tbl .pc-cell { white-space: nowrap; }
.quality-tbl .pc-cell .small { font-weight: 400; }

/* 0.9.9.4, доработка: общий список выбора людей (PeoplePick). Короткие постоянные наборы - значками, люди - этим списком. */
.pp { position: relative; }
.pp-one { display: inline-block; max-width: 100%; vertical-align: middle; }
.pp-trig { display: inline-flex; align-items: center; gap: 6px; width: 100%; min-width: 150px; max-width: 100%; text-align: left; cursor: pointer; }
.pp-trig .pp-v { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-trig .ic { flex: none; opacity: .55; }
.pp-trig:disabled { cursor: default; }
.pp-trig:disabled .ic { display: none; }
.kv .pp-one, .field .pp-one, .form-grid .pp-one { display: block; }
.pp-one.auto { max-width: 260px; }
.pp-pop { position: fixed; z-index: 130; display: flex; flex-direction: column; max-height: var(--pp-max, 420px); padding: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.pp-pop.sheet { left: 0; right: 0; bottom: 0; max-height: 80vh; border-radius: var(--radius) var(--radius) 0 0; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
.pp-back { position: fixed; inset: 0; z-index: 129; background: var(--overlay); }
.pp-q { width: 100%; margin-bottom: 6px; flex: none; }
.pp-list { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.pp-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex: none; }
.pp-top .pp-q { flex: 1; min-width: 0; margin: 0; }
.pp-by { flex: none; }
.pp-g + .pp-g { border-top: 1px solid var(--line-2); }
.pp-gh { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 6px; padding: 2px 4px 2px 6px; background: var(--panel); }
.pp-gh > input { flex: none; margin: 0; }
.pp-gt { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 7px 4px; border: 0; background: none; color: inherit; font: inherit; font-size: 12.5px; font-weight: 700; text-align: left; cursor: pointer; border-radius: 6px; }
.pp-gt:hover:not(:disabled) { background: var(--hover); }
.pp-gt:disabled { cursor: default; }
.pp-gt.static { cursor: default; }
.pp-gt .ic { flex: none; opacity: .55; transition: transform .15s; }
.pp-gh.open .pp-gt .ic { transform: rotate(90deg); }
.pp-gn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-gc { flex: none; font-size: 12px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.pp-gc b { color: var(--text, inherit); }
.pp-gh .linkbtn { font-weight: 600; margin-right: 4px; }
.pp-picked { background: var(--hoverband); border-radius: 8px; margin-bottom: 4px; }
.pp-picked .pp-gh { background: transparent; position: static; }
.pp-row { padding-left: 26px; }
.pp-opt { padding-left: 26px; }
.pp-opt.top { padding-left: 8px; }
@media (max-width: 720px) { .pp-opt, .pp-row { min-height: 40px; } .pp-gt { padding: 10px 4px; } }
.pp-opt { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.pp-opt .pp-n { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pp-opt.hi, .pp-opt:focus-visible { background: var(--sel, var(--hover)); outline: none; }
.pp-opt.on { font-weight: 600; }
.pp-opt.on .ic { color: var(--accent, var(--navy)); }
.pp-opt.top { color: var(--muted); }
.pp-opt .n, .pp .sp-row .n, .pp-pop .sp-row .n { flex: none; min-width: 20px; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pp-pop .sp-foot { flex: none; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-2); }
.chip .ic + .ic, .chip .n + .ic { margin-left: 2px; opacity: .55; }
.pp-by.tbl-mode { padding: 0; border: 0; }
/* 0.9.9.4, доработка: поиск в чатах подсказывает, в каких еще вкладках есть найденное. */
.chips.tabs .chip.zero:not(.on) { opacity: .45; }
.found-else { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.empty .found-else { justify-content: center; margin-top: 10px; }
.more .found-else { margin-left: 12px; }
/* 0.9.9.5: свой Telegram - окно подключения по QR. */
.modal.tgc { width: min(460px, calc(100vw - 24px)); top: 12vh; }
.tgc-grid { display: grid; grid-template-columns: 180px 1fr; gap: 14px; align-items: center; }
.tgc-qr { width: 180px; height: 180px; padding: 6px; background: #fff; border-radius: 10px; border: 1px solid var(--line); }
.tgc-qr svg { display: block; width: 100%; height: 100%; }
.tgc-qr svg rect[fill="white"], .tgc-qr svg rect[fill="#ffffff"] { fill: #fff; }
.tgc-qr.empty { display: grid; place-items: center; color: #333; font-size: 12px; }
.tgc-steps { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.tgc-what { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.tgc-ok { display: flex; gap: 10px; align-items: flex-start; }
.tgc-ok > .ic { color: var(--ok, #1f8a4c); flex: none; margin-top: 2px; }
.modal.tgc .tgc-steps b, .modal.tgc form b, .modal.tgc .tgc-ok div b { display: inline; font-size: inherit; }
.modal.tgc .tgc-ok div b { font-size: 14px; }
@media (max-width: 520px) { .tgc-grid { grid-template-columns: 1fr; justify-items: center; } }
/* Отправка от себя в карточке чата. */
.from-pick { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.from-pick .tbl-mode { padding: 0; border: 0; }
.composer .free { width: 100%; }
/* Кейсы клиента (0.9.9.5) */
.cases-box { margin: 8px 0; }
.case-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 4px 0; border-bottom: 1px solid var(--line-2); }
.case-row:last-child { border-bottom: 0; }
.case-row.cur b { color: var(--accent, inherit); }
/* Закрепы: что не закреплено (0.9.9.5) */
.pin-miss { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 12px; background: var(--gold-bg); border-bottom: 1px solid var(--line-2); }
.pin-miss-i { white-space: nowrap; }

/* ---------- Радар ---------- */
.radar { gap: 12px; }
.radar-head { gap: 10px; }
.radar-viewers { gap: 8px; }
.radar-set, .radar-send { gap: 8px; align-items: center; }
.radar-set label { gap: 6px; }
.radar-time { width: 132px; height: 30px; }
.radar-send .input { width: 150px; height: 30px; }
.radar-day { display: flex; flex-direction: column; gap: 8px; }
.radar-dh { font-weight: 600; margin-top: 4px; }
.radar-dh::first-letter { text-transform: uppercase; }
.radar-item { display: flex; flex-direction: column; gap: 8px; border-left: 3px solid var(--gold); }
.radar-item.high { border-left-color: var(--red); }
.radar-item.done { border-left-color: var(--line-3); opacity: 0.8; }
.radar-top { gap: 8px; align-items: center; }
.radar-title { font-weight: 700; color: var(--text); text-decoration: none; }
.radar-title:hover { text-decoration: underline; }
.radar-score {
  display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--gold-bg); color: var(--gold); font-size: 12px; font-weight: 700;
}
.radar-score.high { background: var(--red-bg); color: var(--red); }
.radar-tags .chip { height: 22px; font-size: 12px; padding: 0 8px; }
.radar-tags .chip.w3 { color: var(--red); border-color: var(--red); }
.radar-tags .chip.w2 { color: var(--gold); border-color: var(--gold); }
.radar-tags .chip.red { color: #fff; background: var(--red); border-color: var(--red); }
.radar-team { gap: 4px; }
.radar-tabs .chip { height: 32px; padding: 0 14px; font-weight: 600; }
.radar-set select.input { width: auto; }
.tc-tbl th { white-space: normal; line-height: 1.25; vertical-align: bottom; }
.tc-tbl th.tc-c, .tc-tbl td.tc-c { text-align: center; min-width: 60px; }
.tc-tbl td { vertical-align: middle; }
.tc-tbl th, .tc-tbl td { padding-left: 6px; padding-right: 6px; }
.tc-tbl th:first-child, .tc-tbl td:first-child { padding-left: 12px; }
.tc-tbl td.tc-who { white-space: nowrap; }
.tc-name { font-weight: 600; }
.tc-who .tc-reptag { margin-left: 8px; }
.tc-tbl td.tc-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tc-rep { display: inline-block; width: 1.1em; margin-left: 2px; text-align: left; color: var(--red); }
.tc-tbl td.tc-cell.bad { color: var(--red); font-weight: 600; }
.tc-tbl td.tc-cell.some { color: var(--gold); }
.tc-tbl td.tc-cell.ok { color: var(--muted); }
.tc-tbl tr.on td { background: var(--hover); }
.tag.tc-reptag { color: var(--red); border-color: var(--red); }
.tc-open > td { padding: 0; background: var(--panel-2); }
.tc-detail { position: sticky; left: 0; max-width: min(860px, calc(100vw - 48px)); gap: 14px; padding: 12px; white-space: normal; }
.tc-check { gap: 6px; }
.tc-item { line-height: 1.45; overflow-wrap: anywhere; }
.tc-q { color: var(--muted); padding-left: 10px; border-left: 2px solid var(--line); margin: 2px 0; }
.radar-rules { gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--ctl); background: var(--line-2); }
.radar-rules-text p { margin: 0 0 6px; font-size: 13px; line-height: 1.5; }
.radar-rules-text p:last-child { margin-bottom: 0; }
.radar-rules-w { gap: 6px; }
.radar-rule { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.radar-rule .chip { height: 22px; font-size: 12px; padding: 0 8px; flex: none; }
.radar-rule .chip.w3 { color: var(--red); border-color: var(--red); }
.radar-rule .chip.w2 { color: var(--gold); border-color: var(--gold); }
.radar-rule .chip.red { color: #fff; background: var(--red); }
.radar-q.team { background: transparent; border: 1px dashed var(--line); }
.radar-q { padding: 6px 10px; border-radius: var(--ctl); background: var(--line-2); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.radar-act { gap: 6px; align-items: center; }
.radar-pass { display: flex; flex-direction: column; gap: 6px; }

/* Библиотека ресурсов (база знаний, вкладка "Библиотека ресурсов") */
.kb-lib { display: grid; gap: 12px; }
.kb-lib-box { padding: 6px 0; }
.kb-lib-path { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 16px 10px; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.kb-lib-row { display: grid; grid-template-columns: 28px 1fr auto 16px; gap: 10px; align-items: center; padding: 9px 16px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line-2); }
.kb-lib-row:last-child { border-bottom: 0; }
.kb-lib-row:hover { background: var(--hover); }
.kb-lib-row.arch { opacity: .6; }
.kb-lib-ic { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 8px; background: var(--line-2); color: var(--muted); }
.kb-lib-ic.f { color: var(--gold); }
.kb-lib-n { overflow-wrap: anywhere; }
@media (max-width: 640px) { .kb-lib-row { grid-template-columns: 28px 1fr 16px; } .kb-lib-d { display: none; } }

/* Расшифровка цифр дашборда (0.9.9.7): число - кнопка, по клику окно со списком чатов. */
.drill-n { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline dotted; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 3px; }
.drill-n:hover, .drill-n:focus-visible { text-decoration-style: solid; text-decoration-color: currentColor; }
.modal.drill { width: min(640px, calc(100vw - 24px)); top: 8vh; max-height: 84vh; overflow: auto; }
.modal.drill .lrow { padding-left: 0; padding-right: 0; }
/* Приложения и база ресурсов (0.9.9.9). */
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.app-card { display: flex; flex-direction: column; gap: 6px; color: inherit; text-decoration: none; }
.app-card:hover { border-color: var(--line-3); }
.res-page { max-width: 1200px; }
.res-page .search { max-width: none; flex: 1; min-width: 200px; }
.res-table-wrap { overflow-x: auto; }
.res-table td { overflow-wrap: break-word; }
.res-table .ellip { max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-reason { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.res-text { min-height: 140px; font-family: inherit; resize: vertical; }
.modal.res-card { width: min(880px, calc(100vw - 24px)); top: 5vh; max-height: 90vh; overflow: auto; }
.res-title { font-size: 16px; }
.res-note { background: var(--panel-2); border-radius: 8px; padding: 8px 10px; font-size: 13px; white-space: pre-wrap; }
.res-decide { border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.res-sec { margin-top: 6px; }
.red { color: var(--red); }
@media (max-width: 860px) { .res-table th:nth-child(5), .res-table td:nth-child(5) { display: none; } }
.res-page select.input.sm { width: auto; max-width: 100%; }
.res-page .row > select.input.grow { flex: 1; }
@media (max-width: 600px) { .res-list th:nth-child(2), .res-list td:nth-child(2) { display: none; } .res-table .ellip { max-width: 180px; } }
@media (max-width: 600px) { .res-uses th:nth-child(4), .res-uses td:nth-child(4) { display: none; } }
.res-claude summary { cursor: pointer; list-style-position: inside; }
.res-claude summary .muted { margin-left: 6px; }

/* ---------- Планер (0.9.9.10) ---------- */
.plan-tabs { margin: 0 0 14px; }
.plan-tabs .chip svg.ic { width: 14px; height: 14px; }
.pl-page { max-width: 1440px; }
.pl-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.pl-top .plan-tabs { margin: 0; }
.pl-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px; align-items: start; }
.pl-layout.with-panel { grid-template-columns: 210px minmax(0, 1fr) 340px; }
.pl-layout.v-week.with-panel { grid-template-columns: 210px minmax(0, 1fr) 320px; }
.pl-rail { position: sticky; top: 0; display: flex; flex-direction: column; gap: 1px; }
.pl-ri { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 10px; border: 0; border-radius: var(--ctl); background: none; color: var(--text); font: inherit; font-size: 13.5px; text-align: left; text-decoration: none; cursor: pointer; }
.pl-ri:hover { background: var(--line-2); text-decoration: none; }
.pl-ri.on { background: var(--sel); font-weight: 600; }
.pl-ri svg.ic { color: var(--muted); flex: none; }
.pl-ri span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-ri .n { font-size: 12px; font-weight: 600; color: var(--muted); }
.pl-ri .n.hot { color: var(--red); }
.pl-ri.add { color: var(--muted); }
.pl-rh { font-size: 12px; font-weight: 600; color: var(--muted); padding: 14px 10px 4px; }
.pl-ldot { width: 9px; height: 9px; border-radius: 50%; flex: none; margin: 0 2px; }
.pl-newlist { padding: 2px 4px; }
.pl-body { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.pl-head { display: flex; align-items: flex-end; gap: 8px; }
.pl-head h2 { margin: 0; font-size: 22px; line-height: 1.2; }

.pl-quick { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.pl-quick:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--ring); }
.pl-quick-row { display: flex; align-items: center; gap: 8px; }
.pl-quick-in { flex: 1; min-width: 0; border: 0; outline: none; background: none; font: inherit; font-size: 14.5px; height: 30px; color: var(--text); }
.pl-quick-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pl-quick.compact { padding: 4px 8px; }
.pl-quick.compact .pl-quick-in { font-size: 13px; height: 26px; }
.tag.warn { background: var(--st-warn-bg); color: var(--warn-text); }
.tag.pl-chat { background: var(--blue-bg); color: var(--blue); border: 0; cursor: pointer; font-family: inherit; }
.tag.pl-chat:hover { filter: brightness(0.96); }
.tag.pl-chip-day, .tag.pl-chip-someday { background: var(--sel); color: var(--text); }
.tag.pl-chip-due { background: var(--st-warn-bg); color: var(--warn-text); }
.tag.pl-chip-chat { background: var(--blue-bg); color: var(--blue); }
.tag.pl-ltag i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.pl-crm-all { padding-top: 6px; border-top: 1px solid var(--line-2); }
.pl-rename { flex: 1; max-width: 420px; }
.pl-layout.v-week { grid-template-columns: minmax(0, 1fr); }
.pl-layout.v-week .pl-rail { display: none; }
.pl-layout.v-week.with-panel { grid-template-columns: minmax(0, 1fr) 320px; }

.pl-sec { display: flex; flex-direction: column; gap: 6px; }
.pl-sec-h { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.pl-sec-h b.lost { color: var(--red); }
.pl-list { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pl-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; cursor: pointer; border-top: 1px solid var(--line-2); }
.pl-list > .pl-row:first-child, .pl-list > div:first-child > .pl-row { border-top: 0; }
.pl-row:hover { background: var(--hover); }
.pl-row.on { background: var(--sel); }
.pl-row.done .pl-t { color: var(--muted); text-decoration: line-through; }
.pl-check { flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--line-3); background: var(--panel); padding: 0; display: grid; place-items: center; color: var(--on-solid); cursor: pointer; }
.pl-check:hover { border-color: var(--green); }
.pl-check.on { background: var(--green); border-color: var(--green); }
.pl-check.lg { width: 24px; height: 24px; margin-top: 3px; }
.pl-check svg.ic { width: 12px; height: 12px; stroke-width: 3; }
.pl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pl-t { font-size: 14px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.pl-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.pl-meta:empty { display: none; }
.pl-meta svg.ic { width: 12px; height: 12px; vertical-align: -2px; }
.pl-side { flex: none; font-size: 12.5px; font-weight: 600; color: var(--muted); padding-top: 2px; }
.pl-side.late { color: var(--red); }
.pl-none { padding: 14px; background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); }
.pl-close-row { margin-top: 2px; }
.lost-t { color: var(--red); }
.strike { text-decoration: line-through; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

.pl-crm { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.pl-crm .pl-sec-h { padding-bottom: 4px; }
.pl-crm-i { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line-2); }
.pl-crm-i .pl-t { font-size: 13px; }
.pl-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--line-3); }
.pl-dot.hot { background: var(--red); }
.pl-crm.compact { padding: 8px 10px; }

.pl-panel { position: sticky; top: 0; max-height: calc(var(--app-h, 100dvh) - 120px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.pl-panel-back { display: none; }
.pl-panel-h { display: flex; align-items: flex-start; gap: 10px; }
.pl-title-in { flex: 1; min-width: 0; border: 1px solid transparent; border-radius: var(--ctl); background: none; font: inherit; font-size: 16px; font-weight: 600; line-height: 1.35; padding: 2px 6px; resize: none; color: var(--text); }
.pl-title-in:hover { border-color: var(--line); }
.pl-title-in:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--ring); }
.pl-title { flex: 1; font-size: 16px; line-height: 1.35; padding-top: 2px; }
.pl-f { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 8px; align-items: start; font-size: 13px; }
.pl-f > span:first-child { color: var(--muted); padding-top: 5px; }
.pl-f.col { display: flex; flex-direction: column; gap: 6px; }
.pl-f.col > span:first-child { padding-top: 0; }
.pl-f-v { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pl-f-v select.input { width: auto; max-width: 100%; }
.pl-dt { flex-wrap: wrap; gap: 6px; }
.pl-dt .input { width: auto; }
.chip.sm { height: 24px; padding: 0 9px; font-size: 12px; }
.pl-cl { display: flex; flex-direction: column; gap: 4px; }
.pl-cl-i { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.pl-cl-i span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pl-box { flex: none; width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--line-3); background: var(--panel); padding: 0; display: grid; place-items: center; color: var(--on-solid); cursor: pointer; }
.pl-box.on { background: var(--green); border-color: var(--green); }
.pl-box svg.ic { width: 11px; height: 11px; stroke-width: 3; }
.pl-panel-f { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line-2); padding-top: 12px; }
.pl-move-wrap { position: relative; }
.pl-move { position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 30; width: 260px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 6px; display: flex; flex-direction: column; }
.pl-move-i { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 0; border-radius: var(--ctl); background: none; font: inherit; font-size: 13.5px; color: var(--text); cursor: pointer; text-align: left; }
.pl-move-i:hover { background: var(--line-2); }
.pl-move-i small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.pl-move-date { display: flex; gap: 6px; padding: 6px 4px 2px; border-top: 1px solid var(--line-2); margin-top: 4px; }

.pl-load { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.pl-bar { height: 8px; border-radius: 4px; background: var(--line-2); display: flex; overflow: hidden; }
.pl-bar.sm { height: 5px; }
.pl-bar i { display: block; height: 100%; }
.pl-bar i.calls, .pl-legend i.calls { background: var(--blue); }
.pl-bar i.tasks, .pl-legend i.tasks { background: var(--navy); }
.pl-bar i.tasks.over { background: var(--red); }
.pl-legend { display: flex; gap: 14px; flex-wrap: wrap; }
.pl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pl-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.pl-morning { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--radius); background: var(--blue-bg); border: 1px solid var(--blue-line); color: var(--text); font-size: 13.5px; }
.pl-day { display: flex; flex-direction: column; gap: 14px; }
.pl-day-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 0.9fr); gap: 14px; align-items: start; }
.pl-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pl-col-h { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.pl-sub-h { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 4px; }
.pl-pick { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; }
.pl-pick .pl-main { cursor: pointer; }
.pl-pick .pl-t { font-size: 13px; }
.pl-dragging { opacity: 0.5; }
.pl-row[draggable='true'] { cursor: grab; }
.pl-ev { display: flex; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-left-width: 1px; border-radius: var(--radius); padding: 8px 10px; }
.pl-ev.k-call, .pl-ev.k-meet, .pl-ev.k-attorney { background: var(--blue-bg); border-color: var(--blue-line); }
.pl-ev-t { flex: none; font-size: 12.5px; font-weight: 700; color: var(--blue); min-width: 42px; }
.pl-ev .pl-t { font-size: 13px; }

.pl-week { display: flex; flex-direction: column; gap: 10px; }
.pl-week-nav { gap: 8px; }
.pl-week-scroll { overflow-x: auto; padding-bottom: 6px; }
.pl-week-grid { display: grid; gap: 10px; align-items: start; }
.pl-wcol { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 380px; }
.pl-wcol.over { border-color: var(--blue); box-shadow: 0 0 0 3px var(--ring); }
.pl-wcol.past { opacity: 0.6; }
.pl-wcol.today { border-color: var(--navy-3); }
.pl-wcol-h { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.tag.on-tag { background: var(--navy); color: var(--on-accent); }
.tag.pl-dk { background: var(--green-bg); color: var(--green); align-self: flex-start; }
.pl-wev { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: var(--blue); }
.pl-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--ctl); padding: 8px; display: flex; flex-direction: column; gap: 5px; cursor: grab; box-shadow: 0 1px 2px rgba(18, 35, 58, 0.05); }
.pl-card:hover { border-color: var(--line-3); }
.pl-card .pl-t { font-size: 13px; }
.pl-time { color: var(--blue); }
.pl-wadd { border: 1px dashed var(--line-3); border-radius: var(--ctl); background: none; color: var(--muted); font: inherit; font-size: 12.5px; padding: 6px; cursor: pointer; }
.pl-wadd:hover { color: var(--text); border-color: var(--muted); }

.modal.pl-closeday { width: min(560px, calc(100vw - 24px)); top: 8vh; max-height: 84vh; overflow: auto; }
.pl-close-sum { display: flex; align-items: baseline; gap: 8px; }
.pl-big { font-size: 34px; font-weight: 700; line-height: 1; }
.pl-close-list { display: flex; flex-direction: column; gap: 8px; }
.pl-close-i { display: flex; flex-direction: column; gap: 5px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.pl-close-i .tbl-mode { padding: 0; border: 0; flex-wrap: wrap; }
.pl-cat { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius); background: var(--green-bg); color: var(--green); }
.modal.pl-quickmodal { width: min(560px, calc(100vw - 24px)); top: 14vh; }
.pl-quote { border-left: 2px solid var(--line-3); padding-left: 8px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; max-height: 76px; overflow: hidden; }
.pl-mini { display: flex; flex-direction: column; }
.pl-mini-i { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line-2); }
.pl-mini-i .pl-t { flex: 1; font-size: 13px; }
.tasks-own { display: flex; align-items: center; gap: 8px; padding: 9px 12px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text); text-decoration: none; font-size: 13.5px; }
.tasks-own:hover { border-color: var(--line-3); text-decoration: none; }
.tasks-own span { flex: 1; }
.top-add { margin-right: 2px; }

@media (max-width: 1180px) {
  .pl-layout.with-panel { grid-template-columns: 190px minmax(0, 1fr); }
  .pl-panel { position: fixed; z-index: 70; right: 12px; top: 64px; bottom: 12px; width: min(380px, calc(100vw - 24px)); max-height: none; box-shadow: var(--shadow-pop); }
  .pl-panel-back { display: block; position: fixed; inset: 0; z-index: 69; background: var(--overlay); }
  .pl-day-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pl-agenda { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .pl-layout, .pl-layout.with-panel { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .pl-rail { position: static; flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 2px; scrollbar-width: none; }
  .pl-rail::-webkit-scrollbar { display: none; }
  .pl-ri { width: auto; flex: none; border: 1px solid var(--line); border-radius: var(--pill); padding: 5px 11px; background: var(--chip-bg); }
  .pl-ri.on { background: var(--navy); color: var(--on-accent); border-color: var(--navy); }
  .pl-ri.on svg.ic, .pl-ri.on .n { color: var(--on-accent); }
  .pl-ri span:first-of-type { flex: none; }
  .pl-rh { display: none; }
  .pl-newlist { flex: none; width: 170px; }
  .pl-day-grid { grid-template-columns: minmax(0, 1fr); }
  .pl-plan { order: -1; }
  .pl-panel { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 86vh; border-radius: 16px 16px 0 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .pl-head h2 { font-size: 20px; }
  .pl-week-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .pl-wcol { min-height: 0; }
  .pl-move { position: fixed; left: 12px; right: 12px; bottom: 80px; width: auto; }
  .plan-tabs { flex-wrap: nowrap; overflow-x: auto; }
}

/* ---------- левое меню под себя (0.9.9.10) ---------- */
.nav-more { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; margin-top: 2px; border: 0; border-radius: var(--ctl); background: none; color: var(--side-dim); font: inherit; font-weight: 500; cursor: pointer; text-align: left; }
.nav-more:hover { background: var(--side-hover); color: var(--side-fg); }
.nav a.nav-hidden { opacity: 0.75; }
.app.nav-compact .nav { gap: 0; }
.app.nav-compact .nav a, .app.nav-compact .nav-more { padding-top: 6px; padding-bottom: 6px; font-size: 13.5px; }
.app.nav-compact .nav a.nav-help { margin-top: 4px; }
.app.nav-compact .brand { padding-bottom: 10px; }
.app.nav-compact .side { padding-top: 12px; }
.nav-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 14px; }
.nav-pick-i { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
:root:not([data-theme='mono']) .app.side-mini .nav-more { justify-content: center; padding: 10px 0; }
:root:not([data-theme='mono']) .app.side-mini .nav-more .nav-t { display: none; }
.pl-card .tag, .pl-pick .tag, .pl-row .tag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* Глоссарий координатора: метка у сообщения и подсказки под текстом (0.9.9.14) */
.rtag.gl-tag { border: 0; cursor: pointer; font: inherit; font-size: 11px; }
.rtag.gl-hard { background: var(--red-bg); color: var(--red); }
.rtag.gl-style { background: var(--gold-bg); color: var(--gold); }
.rtag.gl-ask { background: var(--line-2); color: var(--muted); }
.rtag.gl-tag.on { outline: 1px solid currentColor; }
.gl-box { margin-top: 6px; padding: 6px 8px; border-radius: 8px; background: var(--gold-bg); font-size: 12.5px; }
.gl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.gl-list li b { font-weight: 600; }
.gl-list li.gl-hard b { color: var(--red); }
.gl-arrow { color: var(--faint); }
.gl-why { color: var(--muted); font-size: 11.5px; }
.gl-hint { font-size: 12.5px; border-radius: 8px; padding: 6px 10px; display: flex; gap: 6px; align-items: flex-start; background: var(--gold-bg); color: var(--text); }
.gl-hint.gl-hard { background: var(--red-bg); }
.gl-hint.gl-ask { background: var(--line-2); }
.gl-hint .gl-head { font-weight: 600; display: block; margin-bottom: 2px; }

/* Радар: поиск, отбор, сортировка, сводка с графиками (0.9.9.15) */
.radar-tools { gap: 8px; align-items: center; }
.radar-tools select.input { width: auto; max-width: 220px; height: 32px; }
.radar-q-in { display: flex; align-items: center; gap: 6px; flex: 1 1 240px; max-width: 360px; color: var(--muted); }
.radar-q-in .input { height: 32px; }
.radar-sum { display: flex; flex-direction: column; gap: 8px; }
.radar-sum-g { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.rbars { padding: 4px 0; }
.rbars .bar { grid-template-columns: 170px 1fr 32px; }
.rbars .bar.on .lbl { font-weight: 700; }
.rbars .bar.on .track { outline: 1px solid var(--s-blue); outline-offset: 1px; }
.rbars .bar .fill.hot { background: var(--red); }
.rbars .bar .fill.team { background: var(--gold); }
.rdays { display: flex; align-items: flex-end; gap: 6px; overflow-x: auto; padding: 4px 0; min-height: 120px; }
.rday { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 30px; font-size: 11px; }
.rday-c { width: 18px; background: var(--s-blue); border-radius: 4px 4px 0 0; }
.rday-n { font-weight: 700; }
.rday-l { color: var(--muted); }
@media (max-width: 700px) { .rbars .bar { grid-template-columns: 110px 1fr 28px; } .radar-tools select.input { max-width: 100%; flex: 1 1 140px; } }

/* Меню группами (0.9.9.15): подпись группы и разделитель перед нижними пунктами. */
.nav-grp { padding: 12px 10px 3px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; color: var(--side-dim); opacity: 0.8; }
.nav-sep { height: 1px; margin: 8px 10px; background: var(--side-hover); }
.side-mini .nav-grp { display: none; }
.app.nav-compact .nav-grp { padding-top: 8px; }

/* Запросы (0.9.9.15) */
.rq-page { display: flex; flex-direction: column; gap: 10px; }
.rq-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rq-kindbar .chip { font-size: 12.5px; }
.rq-filters { gap: 10px; align-items: center; }
.rq-search { flex: 1; min-width: 200px; max-width: 360px; }
.rq-list { display: flex; flex-direction: column; gap: 8px; }
.rq-row { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.rq-row.done { opacity: 0.8; }
.rq-row.arch { background: var(--panel-2); }
.rq-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.rq-day { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; min-width: 52px; }
.rq-client { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; text-align: left; }
.rq-client:hover { color: var(--blue); text-decoration: underline; }
.rq-sum { white-space: pre-wrap; font-size: 13.5px; line-height: 1.45; }
.rq-sum.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.rq-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.rq-step { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.rq-step.ro { cursor: default; }
.rq-step.opt { border-style: dashed; }
.rq-step.on { background: var(--green-bg); border-color: transparent; color: var(--green); }
.rq-step small { opacity: 0.8; }
.rq-step svg.ic { width: 12px; height: 12px; }
button.rq-step:hover { border-color: var(--line-3); color: var(--text); }
button.rq-step.on:hover { filter: brightness(0.97); color: var(--green); }
.rq-comment { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.rq-c-t { white-space: pre-wrap; }
.rq-more { align-self: flex-start; }
.rq-det { display: grid; gap: 4px; font-size: 13px; }
.rq-det > div { display: grid; grid-template-columns: minmax(120px, 220px) 1fr; gap: 10px; }
.rq-det span:last-child { white-space: pre-wrap; }
.rq-client-modal { width: min(820px, 96vw); max-height: 88vh; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.rq-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 14px; }
.rq-info > div { display: flex; flex-direction: column; gap: 2px; }
.rq-info span { font-size: 11.5px; color: var(--muted); }
.rq-new { width: min(640px, 96vw); max-height: 90vh; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.rq-found { display: flex; flex-direction: column; }
.rq-draft { display: flex; flex-direction: column; gap: 2px; }
.rq-kinds { display: flex; flex-direction: column; gap: 8px; }
.rq-when { background: var(--panel-2); border-radius: var(--radius); padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.rq-ppr { color: var(--orange); }
.rq-ppr .linkbtn { margin-left: 4px; }
.rq-pprlist { display: flex; flex-direction: column; gap: 4px; }
.rq-pprlist > div { padding-left: 8px; border-left: 3px solid var(--line-2); }
.rq-pprlist > div.yes { border-color: var(--green); }
.rq-pprlist > div.wait { border-color: var(--orange); }
.rq-pprlist > div.no { border-color: var(--red); }
.rq-pprlist .linkbtn { align-self: flex-start; }
.rq-pprlist .rq-dec { font-weight: 600; }
.rq-warn { display: flex; align-items: center; gap: 6px; color: var(--orange); }
.rq-warn { background: var(--orange-bg); border-radius: var(--radius); padding: 6px 10px; }
.rq-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.rq-per { display: flex; align-items: center; gap: 6px; flex: 1; }
.rq-fam { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.rq-fam select { width: auto; }
.rq-fam .rq-age { width: 64px; }
.rq-prev { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.rq-rules { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 2px; }
.tag.rq-k-prolong { background: var(--blue-bg); color: var(--blue); }
.tag.rq-k-services { background: var(--gold-bg); color: var(--gold); }
.tag.rq-k-term { background: var(--red-bg); color: var(--red); }
.tag.rq-k-filing { background: var(--t-teal-bg); color: var(--t-teal); }
.tag.rq-k-neo { background: var(--violet-bg); color: var(--violet); }
.tag.rq-k-anna { background: var(--t-pink-bg); color: var(--t-pink); }
.tag.rq-k-ppr { background: var(--orange-bg); color: var(--orange); }
.tag.rq-k-pip { background: var(--line-2); color: var(--text); }
@media (max-width: 860px) { .rq-det > div { grid-template-columns: 1fr; gap: 0; } .rq-search { max-width: none; } }

/* Переводчик времени в шапке (0.9.9.15.5) */
.tzc { display: flex; flex-direction: column; gap: 8px; padding: 4px 14px 14px; }
.tzc-rows { display: flex; flex-direction: column; gap: 4px; }
.tzc-row { display: grid; grid-template-columns: 52px auto 1fr; align-items: baseline; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--line); background: none; color: var(--text); padding: 8px 10px; border-radius: 8px; }
button.tzc-row { cursor: pointer; }
button.tzc-row:hover { background: var(--hover); }
.tzc-row.src { background: var(--blue-bg); border-color: transparent; }
.tzc-time { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tzc-time .tag { font-size: 11px; font-weight: 500; margin-left: 4px; }
.tzc-row .muted { text-align: right; }
.tzc-hint .linkbtn { border: 0; background: none; padding: 0; font: inherit; color: var(--blue); cursor: pointer; }
@media (max-width: 600px) { .tzc-row { grid-template-columns: 44px auto; } .tzc-row .muted { grid-column: 1 / -1; text-align: left; } }

/* Раздел "Регламент" (0.9.9.15.6): ответы теста, просрочки. */
.ok-txt { color: var(--green, #1a7f37); }
.bad-txt { color: var(--orange); }
.card.warn { border-color: var(--orange); }
