/*
  KAM-Management — стили по корпоративному стилю ООО «КАМ-Проект» (скилл kam-design).
  Скопированы из КАМ-Финанс (Э0). С Э1 (26.10.2026) две темы:
    * светлая — основная (палитра kam-design, п. 1.3): белый фон, графитовый текст, тёплые серые;
    * тёмная — по выбору в профиле (html[data-theme="dark"]): графит + оранжевый, как было в Э0.
  Все цвета — переменные (токены) ниже; в правилах цвет «напрямую» не пишем, только var(--…).
  Оранжевый #E0762F — для кнопок, линий и плашек; для мелкого текста на белом — #A8481A (--accent-text).
  Прямые углы (скругление 2px только у кнопок и полей), без теней и градиентов
  (тень — только у всплывающего уведомления).
*/

/* --- Светлая тема (по умолчанию) --- */
:root {
  --ground: #FFFFFF; --bg: #FFFFFF; --surface: #F7F5F3; --surface2: #F1EFED; --hair: #E2DEDA;
  --line-art: #D3CEC9;
  --text: #232323; --text-soft: #5E5A56; --muted: #6E6A66; --note: #8A8580; --dim: #85807B;
  --strong: #1B1B1B;                         /* заголовки и выделенное */
  --accent: #E0762F; --accent-hover: #EC8A45;
  --accent-text: #A8481A;                    /* оранжевый для текста на белом */
  --ok: #3F7A35; --ok-line: #BFD8B8; --warn: #8A5A12; --warn-bg: #FBF1E1; --warn-line: #E6CFA6;
  --bad: #B03A3A; --bad-bg: #FBE9E9; --bad-text: #8E2424;
  --overlay: rgba(255, 255, 255, .94);       /* фон плавающих кнопок */
  --shadow: 0 6px 26px rgba(35, 35, 35, .16);
  --scheme: light;                           /* календарь и стрелки полей браузера */
  /* Э7: 'Noto Color Emoji' сразу после Manrope — смайлики одинаковые на всех устройствах (решение 28.10.2026) */
  --font: 'Manrope', 'Noto Color Emoji', 'Montserrat', 'Segoe UI', system-ui, Arial, sans-serif;
  --on-light: #1B1B1B; --on-dark: #FFFFFF;   /* текст на цветной плашке: тёмный на светлой, белый на тёмной */
  /* «Мой план» (Э3): цвета колонок как в Битрикс24 и цвет текста на них */
  --plan-todo: #E8352B; --plan-todo-text: #FFFFFF;
  --plan-deferred: #EE6B4D; --plan-deferred-text: #FFFFFF;
  --plan-control: #F7B39E; --plan-control-text: #1B1B1B;
  --plan-next_week: #FCE68A; --plan-next_week-text: #1B1B1B;
  --plan-this_week: #A9D46F; --plan-this_week-text: #1B1B1B;
  --plan-today: #4F7F1F; --plan-today-text: #FFFFFF;
  --plan-done: #5E5E5E; --plan-done-text: #FFFFFF;
  --own-bg: #FCEFE5;                         /* чаты (Э7): фон своих сообщений — тёплый оттенок оранжевого */
  --scroll-thumb: rgba(35, 35, 35, .32);     /* тонкая полоса прокрутки (Э7) */
  /* Э9. Календарь: цвета слоёв и цвета событий на выбор, виды отсутствий */
  --ev-orange: #E0762F; --ev-blue: #3F7FC6; --ev-green: #4F8A3A; --ev-violet: #8559B8; --ev-red: #C8433B;
  --ev-gray: #8A8580; --ev-teal: #2A8C88; --ev-gold: #B8892A;
  --cal-off: #FAF6F2;                        /* выходной и праздничный день в сетке */
}

/* --- Тёмная тема (выбирается в профиле) --- */
:root[data-theme="dark"] {
  --ground: #1B1B1B; --bg: #232323; --surface: #232323; --surface2: #2A2A2A; --hair: #3A3A3A;
  --line-art: #4E4C49;
  --text: #E8E4E0; --text-soft: #B5B0AB; --muted: #9C9792; --note: #85807B; --dim: #7A7570;
  --strong: #FFFFFF;
  --accent: #E0762F; --accent-hover: #EC8A45;
  --accent-text: #E0762F;
  --ok: #8FBF84; --ok-line: #3E4F3A; --warn: #D2A96B; --warn-bg: #2E2517; --warn-line: #5A4A2E;
  --bad: #E38080; --bad-bg: #3A2020; --bad-text: #FFC9C9;
  --overlay: rgba(27, 27, 27, .92);
  --shadow: 0 6px 26px rgba(0, 0, 0, .45);
  --scheme: dark;
  --own-bg: #3A2B20;
  --scroll-thumb: rgba(255, 255, 255, .28);
  --ev-orange: #E0762F; --ev-blue: #6FA4E0; --ev-green: #8FBF84; --ev-violet: #B394E0; --ev-red: #E38080;
  --ev-gray: #9C9792; --ev-teal: #5FC0BA; --ev-gold: #D9B263;
  --cal-off: #262321;
}

* { box-sizing: border-box; }
/* scrollbar-gutter: место под полосу прокрутки страницы оставлено всегда. Иначе при переходе с короткой
   страницы (без полосы) на длинную (Лента) ширина меняется и всё сдвигается вбок (замечание Александра 30.10.2026). */
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  margin: 0; background: var(--ground); color: var(--text); font-family: var(--font);
  font-size: 13px; font-weight: 400; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--hair); }
a:hover { color: var(--strong); border-bottom-color: var(--accent); }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* --- Каркас ------------------------------------------------------------- */
/* Во всю ширину экрана (замечание Александра 26.10.2026: широкие мониторы). Поля по бокам растут с экраном:
   18 px на узком, до 48 px на широком. Формы ограничены своей шириной (.ref-form) и не растягиваются. */
.wrap { margin: 0 auto; padding: 0 clamp(18px, 2.5vw, 48px); }
.top { border-bottom: 1px solid var(--hair); }
.top .wrap { display: flex; align-items: center; gap: 28px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 18px; border: 0; }
.brand img { width: 132px; height: auto; display: block; }      /* знак не меньше 120px */
.brand span {
  font-size: 10px; font-weight: 700; letter-spacing: 2.4px; text-transform: uppercase; color: var(--muted);
  padding-left: 18px; border-left: 1px solid var(--hair);
}
.nav { display: flex; gap: 2px; margin-left: auto; align-self: stretch; }
.nav a {
  display: flex; align-items: center; padding: 0 16px; color: var(--muted); border: 0;
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 13px;
}
.nav a:hover { color: var(--text); }
.nav a.on { color: var(--strong); border-bottom-color: var(--accent); }
.user { display: flex; align-items: center; gap: 14px; color: var(--dim); font-size: 11.5px; }
.user form { margin: 0; }
.linkbtn { background: none; border: 0; color: var(--muted); font: inherit; font-size: 11.5px; cursor: pointer; padding: 0; }
.linkbtn:hover { color: var(--strong); }

/* Э7 (замечание Александра 28.10.2026): заголовок ближе к шапке — рабочая зона выше на экране */
main { padding: 18px 0 64px; }
.foot { border-top: 1px solid var(--hair); color: var(--dim); font-size: 11px; }
.foot .wrap { display: flex; justify-content: space-between; padding-top: 16px; padding-bottom: 24px; }

/* --- Заголовки -------------------------------------------------------------- */
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 22px; flex-wrap: wrap; }
.eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 2.4px; text-transform: uppercase; color: var(--accent-text); margin: 0 0 8px; }
h1 { font-size: 30px; line-height: 1.15; font-weight: 300; letter-spacing: -.8px; color: var(--strong); margin: 0; }
h1 b { font-weight: 300; color: var(--accent-text); }
.head .aside { color: var(--muted); font-size: 11.5px; text-align: right; max-width: 42ch; }
h2 { font-size: 19px; font-weight: 700; letter-spacing: -.2px; color: var(--strong); margin: 0 0 12px; }

/* Заголовок раздела страницы. С Э3 крупнее, линия — цветом надписи (замечание Александра 26.10.2026):
   блоки «Описание», «Чек-лист», «История»… должны читаться сразу. */
.rubric {
  display: flex; align-items: center; gap: 20px; margin: 44px 0 16px;
  font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--accent-text);
}
.rubric::after { content: ""; flex: 1; border-top: 1px solid currentColor; opacity: .55; }
.rubric small { color: var(--dim); letter-spacing: 1.3px; font-weight: 700; order: 3; }

/* --- Блок фактов ------------------------------------------------------------- */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); border: 1px solid var(--hair); }
.fact { padding: 18px 20px 20px; border-right: 1px solid var(--hair); }
.fact:last-child { border-right: 0; }
.fact-k { font-size: 9.5px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; color: var(--dim); }
.fact-v { font-size: 26px; font-weight: 300; letter-spacing: -.5px; color: var(--strong); margin-top: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fact-v small { font-size: 13px; color: var(--muted); margin-left: 4px; }
.fact-m { font-size: 11px; color: var(--muted); margin-top: 4px; }
.fact-v.accent { color: var(--accent-text); }
.fact-v.names { font-size: 18px; white-space: normal; line-height: 1.3; }   /* ФИО в фактах — переносятся (Э1) */

/* --- Таблицы --------------------------------------------------------------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  font-size: 9.5px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; color: var(--dim);
  text-align: left; padding: 0 12px 10px; border-bottom: 1px solid var(--hair); white-space: nowrap;
}
.tbl th.num { text-align: right; }   /* заголовок числовой колонки — по правому краю, как числа */
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--hair); font-size: 12.5px; vertical-align: top; }
.tbl th:first-child, .tbl td:first-child { padding-left: 0; }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.tbl tbody tr:hover td { background: var(--surface); }
.tbl tfoot td { border-bottom: 0; color: var(--strong); font-weight: 600; }
/* Закреплённая шапка (static/kam/sticky.js сдвигает th вслед за прокруткой).
   Пока шапка «едет», у неё фон страницы и линия снизу, чтобы строки под ней не просвечивали. */
.tbl thead th { position: relative; z-index: 2; }
.tbl thead.stuck th { background: var(--ground); box-shadow: inset 0 -1px 0 var(--hair); }
.tbl.bdds thead tr:first-child th:first-child, .pivot thead th:first-child { z-index: 3; }  /* угол над закреплённой первой колонкой */
/* Стрелки прокрутки широких таблиц (static/kam/scroll-arrows.js): тонкий оранжевый шеврон, без теней. */
.hscroll-btn {
  position: fixed; z-index: 20; display: none; align-items: center; justify-content: center;
  width: 34px; height: 56px; padding: 0; cursor: pointer;
  background: var(--overlay); border: 1px solid var(--hair); border-radius: 2px; color: var(--accent-text);
}
.hscroll-btn.on { display: flex; }
.hscroll-btn:hover { border-color: var(--accent); }
.hscroll-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: miter; }
@media print { .hscroll-btn { display: none !important; } }
.tbl .muted, .muted { color: var(--muted); }
.tbl .dim, .dim { color: var(--dim); }
.tbl .code { color: var(--accent-text); font-weight: 700; font-size: 11px; letter-spacing: .5px; white-space: nowrap; }
.in { color: var(--ok); }
.out { color: var(--text); }
.neg { color: var(--bad); }
.purpose { color: var(--muted); font-size: 11.5px; max-width: 46ch; }
.empty { color: var(--dim); padding: 22px 0; border-bottom: 1px solid var(--hair); }

/* --- Метки ------------------------------------------------------------------ */
.badge {
  display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  padding: 2px 7px; border: 1px solid var(--hair); color: var(--muted); white-space: nowrap; vertical-align: 1px;
}
.badge.test { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.badge.ok { color: var(--ok); border-color: var(--ok-line); }
.badge.bad { color: var(--bad-text); background: var(--bad-bg); border-color: transparent; }
.badge.acc { color: var(--accent-text); border-color: var(--accent); }

/* Полоса «получено от суммы договора» — тонкая линия, как разметка */
.bar { height: 2px; background: var(--hair); margin-top: 6px; min-width: 80px; }
.bar i { display: block; height: 2px; background: var(--accent); }

/* --- Кнопки и поля ----------------------------------------------------------- */
.btn {
  display: inline-block; padding: 10px 16px; background: var(--accent); color: #1B1B1B; border: 0; border-radius: 2px;
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; line-height: 1.3;
}
.btn:hover { background: var(--accent-hover); color: #1B1B1B; }
.btn.sec { background: none; color: var(--text); border: 1px solid var(--hair); font-weight: 600; }
.btn.sec:hover { background: var(--surface); border-color: var(--dim); }
.btn.sm { padding: 6px 11px; font-size: 11.5px; }
.btn[disabled] { opacity: .55; cursor: wait; }
a.btn { border-bottom: 0; }

input[type=text], input[type=number], input[type=password], input[type=file], input[type=email], input[type=search],
input[type=date], input[type=time], input[type=url], select, textarea {
  color-scheme: var(--scheme);   /* календарь и стрелки браузера — в цвет темы */
  width: 100%; padding: 9px 11px; background: var(--surface); color: var(--text);
  border: 1px solid var(--hair); border-radius: 2px; font: inherit; font-size: 13px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[type=file] { padding: 7px; color: var(--muted); }
input[type=file]::file-selector-button {
  background: none; color: var(--text); border: 1px solid var(--hair); border-radius: 2px;
  padding: 5px 10px; margin-right: 10px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
input[type=file]::file-selector-button:hover { border-color: var(--dim); background: var(--surface2); }
label { display: block; font-size: 9.5px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; color: var(--dim); margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.errorlist { list-style: none; margin: 6px 0 0; padding: 0; color: var(--bad); font-size: 11.5px; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin: 0; min-width: 220px; flex: 1; }
.inline-form select { min-width: 180px; }
/* Маленькая форма прямо в ячейке таблицы: выбор и кнопка в одну строку */
.cell-form { display: flex; gap: 8px; align-items: center; margin: -5px 0; }
.cell-form select { width: auto; min-width: 170px; padding: 6px 9px; font-size: 12px; }

/* --- Сетки --------------------------------------------------------------- */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 0 44px; }
.side { display: grid; grid-template-columns: 330px 1fr; gap: 44px; align-items: start; }
.panel { border: 1px solid var(--hair); padding: 20px; }
/* Колонки сетки могут сжиматься уже своего содержимого (иначе широкая таблица раздвигает страницу) */
.grid2 > *, .side > * { min-width: 0; }

/* --- Вкладки -------------------------------------------------------------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--hair); margin-bottom: 20px; }
.tabs a {
  padding: 11px 18px; font-size: 13px; color: var(--muted); border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a.on { color: var(--strong); border-bottom-color: var(--accent); }
.tabs a .cnt { color: var(--accent-text); font-weight: 700; margin-left: 6px; font-size: 11px; }

/* --- Примечание с рантом ---------------------------------------------------- */
.note { border-left: 2px solid var(--accent); padding: 2px 0 2px 15px; font-size: 12.5px; line-height: 1.7; color: var(--dim); margin: 16px 0; }
.warn-list { list-style: none; margin: 0; padding: 0; }
.warn-list li { padding: 10px 0 10px 15px; border-bottom: 1px solid var(--hair); border-left: 2px solid var(--warn); color: var(--text-soft); font-size: 12.5px; }

/* --- Справочники -------------------------------------------------------------- */
.crumb { color: var(--accent-text); border: 0; }
.crumb:hover { color: var(--strong); }
.ref-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 44px; }
.ref-list li { padding: 14px 0; border-bottom: 1px solid var(--hair); }
.ref-list li a { font-size: 15px; font-weight: 600; color: var(--strong); border-bottom-color: var(--hair); }
.ref-list li .cnt { color: var(--accent-text); font-weight: 700; font-size: 11px; margin-left: 8px; }
.ref-list li p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.search { display: flex; gap: 10px; align-items: center; max-width: 520px; margin-bottom: 20px; }
.ref-form { max-width: 640px; }
.help { color: var(--dim); font-size: 11px; margin-top: 5px; }
.actions { display: flex; gap: 10px; margin-top: 24px; }
.delete-form { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--hair); max-width: 640px; }
.linkbtn.danger { color: var(--bad); }
.linkbtn.danger:hover { color: var(--bad-text); }
/* Флажки: фирменный оранжевый, подпись в строку */
input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; margin: 0 8px 0 0; vertical-align: -2px; }
.field.check label, .field div label {
  display: inline-flex; align-items: center; font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--text);
  margin: 0; cursor: pointer;
}
.field div div { padding: 3px 0; }   /* список флажков (роли пользователя) */
input:disabled, select:disabled, textarea:disabled { color: var(--muted); background: var(--ground); }
textarea { min-height: 84px; resize: vertical; }

/* --- Дашборды ---------------------------------------------------------------- */
/* Цвета рядов графика: проверены валидатором палитры на фоне #1B1B1B (CVD ΔE 26,8). */
:root { --series-in: #3987E5; --series-out: #D95926; --series-balance: #E8E4E0; }
.mode-tabs { margin: 0; border-bottom: 0; }
.filters { border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); padding: 18px 0 16px; margin-top: 8px; }
.tl-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.tl-label { color: var(--strong); font-size: 14px; margin-left: 12px; }
.tl-tools { display: flex; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--hair); border-radius: 2px; }
.seg button { background: none; border: 0; border-right: 1px solid var(--hair); color: var(--muted); font: inherit; font-size: 11.5px; padding: 6px 11px; cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--strong); }
.seg button.on { color: var(--strong); background: var(--surface2); }
/* Временная шкала: годы сверху, месяцы строкой; выбранный диапазон — оранжевая «разметка» снизу */
.timeline { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 4px; user-select: none; touch-action: pan-x; }
.tl-year { flex: 0 0 auto; }
.tl-ycap { font-size: 9.5px; font-weight: 700; letter-spacing: 1.3px; color: var(--dim); margin-bottom: 4px; }
.tl-row { display: flex; }
.tl-m {
  width: 52px; padding: 9px 0 8px; background: var(--surface); border: 0; border-right: 1px solid var(--ground);
  border-bottom: 3px solid var(--hair); color: var(--muted); font: inherit; font-size: 12px; cursor: pointer;
}
.tl-m:hover { color: var(--strong); }
.tl-m.sel { color: var(--strong); background: var(--surface2); border-bottom-color: var(--accent); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.chip {
  background: none; border: 1px solid var(--hair); border-radius: 2px; color: var(--muted); font: inherit; font-size: 12px;
  padding: 5px 11px; cursor: pointer;
}
.chip:hover { color: var(--strong); border-color: var(--dim); }
.chip.on { color: var(--strong); border-color: var(--accent); }
.art-pick { margin-top: 10px; }
.art-pick summary, .table-view summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.art-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 32px; padding: 14px 0 4px; }
.art-group label {
  display: flex; align-items: center; font-size: 12.5px; font-weight: 400; letter-spacing: 0; text-transform: none;
  color: var(--text); margin: 6px 0 0; cursor: pointer;
}
.fact-v.hero { font-size: 32px; }
.chart-card { border: 1px solid var(--hair); padding: 20px 20px 16px; margin-top: 28px; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.chart-head h2 { margin: 0; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--text-soft); }
.legend li { display: flex; align-items: center; gap: 7px; }
.key.rect { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.key.line { width: 16px; height: 2px; display: inline-block; }
.chart-box { position: relative; height: 340px; }
.table-view { margin-top: 18px; }
.table-view summary { margin-bottom: 12px; }
.pivot td:first-child, .pivot th:first-child { position: sticky; left: 0; background: var(--ground); min-width: 220px; }
.pivot tr.sec td { color: var(--dim); font-size: 9.5px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; padding-top: 18px; }
.pivot td.strong { color: var(--strong); }
.pivot tfoot td { border-top: 1px solid var(--hair); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); border-top: 1px solid var(--hair); border-left: 1px solid var(--hair); }
.kpi { border-right: 1px solid var(--hair); border-bottom: 1px solid var(--hair); padding: 16px 18px 40px; position: relative; }
.kpi-v { font-size: 22px; font-weight: 300; color: var(--strong); margin-top: 6px; letter-spacing: -.3px; }
.kpi.empty .kpi-v { color: var(--dim); }
.kpi .src { position: absolute; left: 18px; bottom: 14px; }
/* План на шкале и в графике (этап 6): месяцы после текущего — пунктир снизу и курсив, текущий — «факт + план». */
.tl-m.plan { font-style: italic; color: var(--dim); border-bottom-style: dashed; }
.tl-m.plan.sel { color: var(--text-soft); background: var(--surface2); border-bottom-color: var(--accent); }
.tl-m.now { box-shadow: inset 0 2px 0 var(--text-soft); }
.key.rect.plan { opacity: .45; }
.key.line.dash { background: repeating-linear-gradient(90deg, var(--series-balance) 0 4px, transparent 4px 7px) !important; }
.pivot th.plan, .pivot td.plan { font-style: italic; color: var(--text-soft); }
.proj-chart { height: 260px; }

/* --- Касса ---------------------------------------------------------------------- */
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.btn-row form { margin: 0; }
.month-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; font-size: 13px; color: var(--strong); }
.month-nav .dim { font-size: 11.5px; }
@media (max-width: 720px) { .btn-row { justify-content: flex-start; } .month-nav .dim { margin-left: 0 !important; width: 100%; } }

/* --- План ------------------------------------------------------------------------- */
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text); cursor: pointer;
          text-transform: none; letter-spacing: 0; font-weight: 400; margin: 0; }
.badge.src-pipeline { color: var(--accent-text); border-color: var(--accent); }
.badge.src-stage { color: var(--text); }

/* --- Отчёты ---------------------------------------------------------------------- */
.report-filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 8px; }
.report-filters .field { margin: 0; }
.report-filters input[type=number] { width: 90px; }
.report-filters .toggle { align-self: center; }
.tbl.bdds { font-size: 12px; }
.tbl.bdds td, .tbl.bdds th { padding: 7px 8px; white-space: nowrap; }
/* Закреплённая колонка «Статья»: ячейки тела и угловая ячейка шапки (во второй строке шапки первая ячейка — «План» месяца, её не трогаем) */
.tbl.bdds td:first-child, .tbl.bdds thead tr:first-child th:first-child { position: sticky; left: 0; background: var(--ground); min-width: 260px; max-width: 320px; white-space: normal; z-index: 1; }
.tbl.bdds th.per { text-align: center; color: var(--text-soft); border-left: 1px solid var(--hair); }
.tbl.bdds th.per.future { color: var(--dim); }
.tbl.bdds tr > td:nth-child(3n+2) { border-left: 1px solid var(--hair); }
.tbl.bdds .dev { color: var(--dim); }
.tbl.bdds .dev.bad { color: var(--bad); }
.tbl.bdds tr.r-balance td { color: var(--strong); font-weight: 600; }
.tbl.bdds tr.r-summary td { color: var(--text); font-weight: 600; }
.tbl.bdds tr.r-section td { color: var(--accent-text); font-weight: 700; padding-top: 16px; }
.tbl.bdds tr.r-section td:first-child { font-size: 10px; letter-spacing: 1.3px; text-transform: uppercase; }
.tbl.bdds tr.r-group td { color: var(--muted); font-style: italic; }
.tbl.bdds tr.r-article td:first-child { padding-left: 14px; }
.tbl.bdds thead tr + tr th:first-child { padding-left: 12px; }
.tbl.bdds thead tr:first-child th:first-child { z-index: 3; }  /* угол шапки — над закреплённой колонкой и над ячейками шапки */
.tbl.bdds tr.r-spacer td { border: 0; padding: 10px; }

/* --- Контроль 115-ФЗ ---------------------------------------------------------------- */
.badge.zone-green { color: var(--ok); border-color: var(--ok-line); }
.badge.zone-yellow { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.badge.zone-red { color: var(--bad-text); background: var(--bad-bg); border-color: transparent; }
.badge.zone-none { color: var(--dim); }
.badge.sig { color: var(--warn); border-color: var(--warn-line); margin-left: 4px; }
.tbl.aml td { vertical-align: top; }
.tbl.aml .aml-advice { font-size: 12px; max-width: 360px; min-width: 220px; }
.aml-ops { margin-top: 6px; font-size: 11.5px; }
.aml-ops summary { cursor: pointer; color: var(--muted); }
.aml-ops div { padding: 3px 0; }
.btn.btn-sm { display: inline-block; width: auto; padding: 6px 12px; font-size: 12px; }
/* Изменение статьи в карточке операции */
.edit-art { margin-top: 6px; }
.edit-art summary { cursor: pointer; color: var(--accent-text); font-size: 12px; list-style: none; display: inline-block; }
.edit-art summary::-webkit-details-marker { display: none; }
.edit-art-form { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.edit-art-form select { max-width: 360px; min-width: 220px; }
.stmt-check { padding: 10px 0; border-bottom: 1px solid var(--hair); font-size: 12px; }

/* --- Уведомления (единственная тень в стиле) ------------------------------------ */
.toasts { position: fixed; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 10; max-width: 440px; }
.toast {
  background: var(--surface2); border-left: 2px solid var(--accent); padding: 12px 16px; font-size: 12.5px;
  box-shadow: var(--shadow); color: var(--text);
}
.toast.error { border-left-color: var(--bad); }

/* --- Вход ------------------------------------------------------------------- */
.login { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); } /* фон как у картинки города */
.login .box { width: 100%; max-width: 420px; margin: 10vh auto 40px; padding: 0 18px; }
/* Логотип во всю ширину формы и по центру — чтобы подпись «проектирование инфраструктуры» читалась */
.login .box img { width: 100%; max-width: 384px; height: auto; display: block; margin: 0 auto 10px; }
/* Подпись под логотипом — живым текстом, чтобы буквы были чёткими */
.login .tagline { text-align: center; font-size: 12px; font-weight: 500; letter-spacing: 3.2px; text-transform: uppercase;
                  color: var(--text-soft); margin: 0 0 40px; }
/* Название программы — крупнее заголовка «Управление проектами» */
.login .app-title { text-align: center; font-size: 34px; font-weight: 700; letter-spacing: 1.5px; color: var(--accent-text);
                    margin: 0 0 6px; line-height: 1.1; }
.login .box h1 { text-align: center; font-size: 26px; }
.login .city { margin-top: auto; width: 100%; height: auto; display: block; opacity: .9; }

/* --- БДР проекта ---------------------------------------------------------------- */
input[type=month] {
  color-scheme: var(--scheme); width: 100%; padding: 9px 11px; background: var(--surface); color: var(--text);
  border: 1px solid var(--hair); border-radius: 2px; font: inherit; font-size: 13px;
}
.bdr td.num, .bdr th.num { white-space: nowrap; min-width: 92px; }
.bdr th.cur { color: var(--accent-text); }
.bdr-plan { display: block; color: var(--dim); font-size: 10.5px; margin-top: 2px; }   /* план под фактом */
.bdr-h { display: block; color: var(--note); font-size: 10px; margin-top: 2px; }        /* часы под суммой */
.bdr tr.subtotal td { color: var(--text-soft); border-top: 1px solid var(--hair); }
.bdr tr.margin td { color: var(--strong); font-weight: 600; border-top: 1px solid var(--line-art); border-bottom: 1px solid var(--line-art); }
.bdr tr.margin td:first-child { color: var(--accent-text); }
.bdr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 18px; max-width: 980px; }

/* --- Табель часов ----------------------------------------------------------------- */
.hours-grid input.h {
  width: 58px; padding: 6px 6px; text-align: right; background: var(--surface); color: var(--text);
  border: 1px solid var(--hair); border-radius: 2px; font: inherit; font-size: 13px;
}
.hours-grid input.h:focus { outline: none; border-color: var(--accent); }
.hours-grid input.h:disabled { opacity: .35; }
.hours-grid input.h.saving { border-color: var(--warn); }
.hours-grid input.h.err { border-color: var(--bad); color: var(--bad-text); }
.hours-grid th.wknd { color: var(--dim); }
.hours-grid th.cur { color: var(--accent-text); }
.hours-grid tr.cat td:first-child { color: var(--muted); }
.hours-grid td:first-child { min-width: 240px; }

/* --- «Мой месяц»: полоса дней ------------------------------------------------------- */
.day-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; }
.day-strip .day {
  display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border: 1px solid var(--hair);
  border-radius: 2px; color: var(--text); background: var(--surface);
}
.day-strip .day:hover { border-color: var(--accent); }
.day-strip .dn { font-size: 13px; font-weight: 600; }
.day-strip .dw { font-size: 9px; color: var(--dim); text-transform: uppercase; letter-spacing: 1px; }
.day-strip .dh { font-size: 11px; margin-top: 4px; color: var(--text-soft); }
.day-strip .day.wknd { background: none; color: var(--dim); }
.day-strip .day.future, .day-strip .day.off { opacity: .45; }
.day-strip .day.short { border-color: var(--accent); }
.day-strip .day.short .dh { color: var(--accent-text); }

/* --- Бюджет фирмы: таблица «статья × месяц» (этап 7) ------------------------------------ */
.budget-grid { font-size: 12px; }
.budget-grid td, .budget-grid th { padding: 6px 6px; white-space: nowrap; vertical-align: top; }
.budget-grid td:first-child, .budget-grid thead th:first-child { position: sticky; left: 0; background: var(--ground);
  min-width: 230px; max-width: 280px; white-space: normal; z-index: 1; }
.budget-grid thead th:first-child { z-index: 3; }
.budget-grid th.past { color: var(--dim); }
.budget-grid input.b {
  width: 92px; padding: 4px 6px; text-align: right; background: var(--surface); color: var(--text);
  border: 1px solid var(--hair); border-radius: 2px; font: inherit; font-size: 12px;
}
.budget-grid input.b.day { width: 44px; }
.budget-grid input.b:focus { outline: none; border-color: var(--accent); }
.budget-grid input.b:disabled { background: none; border-color: transparent; color: var(--text-soft); }
.budget-grid input.b.saving { border-color: var(--warn); }
.budget-grid input.b.err { border-color: var(--bad); color: var(--bad-text); }
.budget-grid .auto { display: block; color: var(--note); font-size: 10.5px; text-align: right; margin-top: 2px; min-height: 15px; }
.budget-grid tr.sec td { color: var(--accent-text); font-weight: 700; font-size: 10px; letter-spacing: 1.3px;
  text-transform: uppercase; padding-top: 16px; }
.budget-grid tr.tot td { color: var(--text); font-weight: 600; border-top: 1px solid var(--line-art); }
.budget-grid tr.bal td { color: var(--strong); font-weight: 600; }
.budget-grid tr.sales td { background: var(--surface2); }
.budget-grid .fill { background: none; border: 0; color: var(--dim); cursor: pointer; font: inherit; font-size: 11px; padding: 0 2px; }
.budget-grid .fill:hover { color: var(--accent-text); }
.budget-legend { display: flex; gap: 22px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 10px 0 14px; }
.budget-legend b { color: var(--text); font-weight: 600; }
/* БДДС 12 месяцев: месяц-факт / текущий / план */
.tbl.bdds th.per.past { color: var(--text-soft); }
.tbl.bdds th.per.current { color: var(--accent-text); }
.tbl.bdds td.num a { border: 0; color: inherit; }
.tbl.bdds td.num a:hover { color: var(--accent-text); }

/* --- Телефон ------------------------------------------------------------------ */
@media (max-width: 940px) {
  .side { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 18px; }
  .top .wrap { flex-wrap: wrap; gap: 10px 20px; padding-top: 14px; }
  .brand span { display: none; }
  .nav { margin-left: 0; order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }  /* меню листается пальцем, полоса прокрутки не нужна */
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }  /* вкладки листаются пальцем */
  .tabs a { white-space: nowrap; flex: none; }
  .nav a { padding: 12px 12px; }
  .user { margin-left: auto; }
  h1 { font-size: 24px; }
  .fact { border-right: 0; border-bottom: 1px solid var(--hair); }
  .head .aside { text-align: left; }
  /* Широкие таблицы прокручиваются внутри себя, страница по горизонтали не едет */
  .tbl { display: block; overflow-x: auto; }
  .tbl.bdds td:first-child, .tbl.bdds thead tr:first-child th:first-child { min-width: 150px; max-width: 170px; }  /* на телефоне колонка статей уже */
  .cell-form select { min-width: 140px; }
}

/* --- Э1: аватары, профиль, команда проекта, приглашение ------------------------------ */
/* Аватар — круг: фото или инициалы. Круг — исключение из «прямых углов», как у любого портрета. */
.ava {
  display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%;
  object-fit: cover; background: var(--surface2); color: var(--muted); border: 1px solid var(--hair);
  font-weight: 700; letter-spacing: .5px; vertical-align: middle;
}
.user .me { display: inline-flex; align-items: center; gap: 9px; border: 0; color: var(--muted); }
.user .me:hover { color: var(--strong); }
.person { display: inline-flex; align-items: center; gap: 10px; }
.person .dim { display: block; font-size: 11px; }
.profile-ava .ava { width: 128px; height: 128px; font-size: 40px; }
.team-add { margin-top: 16px; }
.team-add .field { min-width: 180px; }
.copy-box { display: flex; gap: 10px; max-width: 760px; margin: 8px 0 8px; }
.copy-box input { font-family: Consolas, 'Courier New', monospace; font-size: 12px; }
#invite-text { max-width: 760px; }
/* Окно подрезки аватара (static/kam/avatar-crop.js). Затемнение вокруг круга — не украшение,
   а маска «что не попадёт в аватар», поэтому здесь допустима тень-заливка. */
.crop-dialog {
  width: min(380px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--hair); border-radius: 0;
  background: var(--ground); color: var(--text);
}
.crop-dialog::backdrop { background: rgba(27, 27, 27, .6); }
.crop-stage {
  position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; background: var(--surface2);
  cursor: grab; touch-action: none; user-select: none;   /* touch-action: none — палец двигает фото, а не страницу */
}
.crop-stage:active { cursor: grabbing; }
.crop-stage img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.crop-mask { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(27, 27, 27, .55);
             outline: 1px solid var(--accent); pointer-events: none; }
.crop-zoom-label { margin-top: 16px; }
.crop-zoom { width: 100%; accent-color: var(--accent); margin-top: 8px; }
.profile-ava canvas.ava { width: 128px; height: 128px; }

@media (max-width: 720px) {
  .user .me > span:not(.ava) { display: none; }   /* на телефоне в шапке — только аватар */
  .copy-box { flex-direction: column; }
}

/* --- Э2: сделки — канбан, полоса стадий, карточка ---------------------------------- */
/* Цвет стадии приходит из справочника стадий в переменной --stage (style="--stage: …" в шаблоне).
   Им красится только тонкая полоска/точка — текст всегда цветами темы. */
.deal-filters { margin: 0 0 18px; }
.deal-filters .field { min-width: 160px; }
.deal-filters select { max-width: 240px; }
.deal-filters input[type=search] { min-width: 260px; }
.kb-sum { display: flex; gap: 22px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-soft); margin-bottom: 12px; }
.kb-sum b { color: var(--strong); font-weight: 600; }
.kb { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
/* Колонки резиновые: делят ширину экрана, но не уже 160 px (10 стадий «Общей» воронки помещаются на 1920 px), дальше — прокрутка вбок. */
.kb-col { flex: 1 0 160px; background: var(--surface); border: 1px solid var(--hair); min-height: 120px; }
.kb-col.over { border-color: var(--accent); background: var(--surface2); }
.kb-head { border-top: 3px solid var(--stage); padding: 10px 12px 8px; border-bottom: 1px solid var(--hair); }
.kb-name { font-size: 11.5px; font-weight: 700; color: var(--strong); line-height: 1.35; min-height: 46px; }   /* до 3 строк названия — строка «число · сумма» во всех колонках на одной высоте */
.kb-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 4px;
           font-variant-numeric: tabular-nums; }
.kb-cards { padding: 8px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.kb-card { background: var(--ground); border: 1px solid var(--hair); padding: 10px 11px; cursor: grab; }
.kb-card:hover { border-color: var(--dim); }
.kb-card.dragging { opacity: .45; }
.kb-card.saving { opacity: .6; cursor: wait; }
.kb-title { display: block; font-size: 12.5px; font-weight: 600; color: var(--strong); border: 0; line-height: 1.4; }
.kb-title:hover { color: var(--accent-text); }
.kb-amount { font-size: 13px; color: var(--text); margin-top: 6px; font-variant-numeric: tabular-nums; }
.kb-line { font-size: 11px; margin-top: 3px; }
.kb-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 8px; font-size: 11px; }
.kb-foot span:not(.ava) { white-space: nowrap; }
.kb-foot .ava { margin-left: auto; }
.kb-empty { color: var(--dim); font-size: 11.5px; text-align: center; margin: 14px 0; }
.kb-finals { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.kb-final { flex: 1 1 200px; min-height: 0; padding: 12px 14px; font-size: 12px; color: var(--text-soft);
            border-style: dashed; border-color: var(--line-art); }
.kb-final b { color: var(--strong); margin-left: 6px; }
.kb-final.success { border-left: 3px solid var(--ok); }
.kb-final.failure { border-left: 3px solid var(--bad); }
.kb-final:hover { color: var(--strong); }
/* Полоса стадий в карточке: пройденные — закрашены, текущая — цвет стадии и жирный шрифт */
.stage-strip { display: flex; gap: 3px; margin: 0 0 26px; overflow-x: auto; padding-bottom: 4px; }
.stage-strip button {
  flex: 1 1 0; min-width: 74px; background: var(--surface);   /* все стадии в одну строку, полное название — в подсказке */ color: var(--muted); border: 0;
  border-bottom: 3px solid var(--hair); font: inherit; font-size: 11px; padding: 9px 10px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stage-strip button:hover { color: var(--strong); background: var(--surface2); }
.stage-strip button.past { border-bottom-color: var(--stage); color: var(--text-soft); }
.stage-strip button.on { border-bottom-color: var(--stage); color: var(--strong); font-weight: 700; background: var(--surface2); }
.stage-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--stage); margin-right: 7px; }
.props { display: grid; grid-template-columns: 170px 1fr; gap: 0; margin: 0; font-size: 12.5px; }
.props dt { color: var(--dim); padding: 8px 12px 8px 0; border-bottom: 1px solid var(--hair); }
.props dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--hair); color: var(--text); min-width: 0; }
.wrap-any { overflow-wrap: anywhere; }
.pay-form { margin-top: 14px; }
.pay-form .field { min-width: 0; flex: 0 1 auto; }
.pay-form input[type=text] { width: 130px; }
.warn-line { color: var(--warn); background: var(--warn-bg); padding: 8px 12px; font-size: 12px; margin: 10px 0 0; }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { padding: 10px 0; border-bottom: 1px solid var(--hair); font-size: 12.5px; }
.hist-when { font-size: 11px; margin-bottom: 3px; }
.hist-ch { color: var(--text-soft); margin-top: 2px; }
.deal-form textarea { min-height: 70px; }
/* Справка из верхней сделки под полем «Верхний договор» (форма нижней сделки) */
.field .upper-info > div { padding: 1px 0; }
.field .upper-info { margin-top: 8px; padding: 8px 12px;   /* .field — сильнее общего правила «.field div div» */ background: var(--surface); border-left: 2px solid var(--accent);
              font-size: 12px; color: var(--text); line-height: 1.7; }
@media (max-width: 720px) {
  .kb-col { flex-basis: 78vw; }
  .props { grid-template-columns: 1fr; }
  .props dt { border-bottom: 0; padding-bottom: 0; }
  .deal-filters .field { flex: 1 1 100%; min-width: 0; }   /* фильтры на телефоне — во всю ширину */
  .deal-filters select { max-width: none; }
  .deal-filters input[type=search] { min-width: 0; }
}

/* --- Кнопка «Показать пароль» (static/kam/password-eye.js) -------------------------- */
.pwd { position: relative; display: block; }
.pwd input { padding-right: 42px; }
.pwd-btn { position: absolute; top: 0; right: 0; bottom: 0; width: 40px; display: flex; align-items: center;
           justify-content: center; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; }
.pwd-btn:hover { color: var(--strong); }
.pwd-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }

/* --- Задачи (Э3) ---------------------------------------------------------------- */
/* Статус задачи — плашка; цвет по коду статуса Б24 (s2 … s6) */
.t-status { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border: 1px solid var(--hair);
            color: var(--text-soft); white-space: nowrap; }
.t-status.s3 { color: var(--accent-text); border-color: var(--accent); }
.t-status.s4 { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.t-status.s5 { color: var(--ok); border-color: var(--ok-line); }
.t-status.s6 { color: var(--dim); border-style: dashed; }
.head .aside .t-status, .head .aside .badge { margin-left: 6px; }
/* Цветная полоска колонки канбана задач */
.t-head { --stage: var(--hair); }
.t-head.s3 { --stage: var(--accent); }
.t-head.s4 { --stage: var(--warn); }
.t-head.s6 { --stage: var(--line-art); }
.t-head .kb-name { min-height: 0; }
/* Кнопки статуса в карточке задачи */
.task-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; margin: 0 0 22px; }
.task-actions form { margin: 0; }
.task-actions .btn:disabled { opacity: .5; cursor: not-allowed; }
.return-box summary { list-style: none; cursor: pointer; }
.return-box summary::-webkit-details-marker { display: none; }
.return-box[open] { flex: 1 1 100%; }
.return-box[open] summary { margin-bottom: 10px; }
.return-box textarea { min-height: 56px; }
/* Чек-лист */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--hair); font-size: 13px; }
.checklist li.done .cl-title { color: var(--dim); text-decoration: line-through; }
.cl-box { flex: 0 0 20px; width: 20px; height: 20px; border: 1px solid var(--line-art); background: var(--ground);
          color: var(--ok); font: inherit; font-size: 13px; line-height: 18px; text-align: center; padding: 0; cursor: pointer; }
span.cl-box { cursor: default; }
.checklist li.done .cl-box { border-color: var(--ok-line); }
.cl-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cl-who { font-size: 11px; white-space: nowrap; }
.cl-del { font-size: 16px; padding: 0 4px; }
/* Форма задачи: люди галочками в две колонки, срок в одну строку */
.task-form { max-width: 820px; }
.people-grid { gap: 0 30px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.people-grid .field > div { max-height: 220px; overflow-y: auto; }
.deadline-row { margin-bottom: 18px; }
.deadline-row .field { flex: 0 1 200px; min-width: 150px; }
/* Главная: «Мои задачи» в три колонки */
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 44px; margin-bottom: 10px; }
.sub-rubric { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-soft);
              padding: 6px 0; border-bottom: 1px solid var(--hair); }
.sub-rubric.neg { color: var(--bad); }
.sub-rubric b { margin-left: 6px; }
.my-task { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--hair); font-size: 12.5px; }
.my-task a { min-width: 0; overflow-wrap: anywhere; }
.my-task span { white-space: nowrap; font-size: 11.5px; }
/* Вкладки на телефоне не помещаются в строку — прокручиваются вбок, страница при этом не уезжает */
@media (max-width: 720px) {
  .tabs { overflow-x: auto; }
  .tabs a { white-space: nowrap; }
}

/* --- Шапка страницы: кнопка «создать» у заголовка, переключатель вида под ним (Э3, для всех разделов) ---- */
.head-title { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.split { display: inline-flex; position: relative; }
.split > .btn { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split-menu { position: relative; }
.split-arrow { list-style: none; border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 1px;
               padding-left: 12px; padding-right: 12px; height: 100%; display: flex; align-items: center; }
.split-arrow::-webkit-details-marker { display: none; }
.split-arrow::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.6px 1.6px 0;
                      transform: rotate(45deg); margin-top: -4px; }
.split-menu[open] .split-arrow::after { transform: rotate(-135deg); margin-top: 4px; }
.split-menu .menu { position: absolute; left: 0; top: calc(100% + 6px); z-index: 50; min-width: 250px; background: var(--ground);
                    border: 1px solid var(--hair); box-shadow: var(--shadow); padding: 6px 0; }
.split-menu .menu a, .split-menu .menu .off { display: block; padding: 10px 16px; font-size: 13px; color: var(--text);
                                              border: 0; white-space: nowrap; }
.split-menu .menu a:hover { background: var(--surface); color: var(--strong); }
.split-menu .menu .off { color: var(--dim); cursor: not-allowed; }
.split-menu .menu .off small { margin-left: 6px; font-size: 10px; color: var(--accent-text); }
.view-switch { display: inline-flex; margin-top: 14px; border: 1px solid var(--hair); }
.view-switch a { padding: 6px 16px; font-size: 12.5px; color: var(--muted); border: 0; }
.view-switch a + a { border-left: 1px solid var(--hair); }
.view-switch a:hover { color: var(--strong); }
.view-switch a.on { color: var(--strong); background: var(--surface2); font-weight: 600; }
/* Подзадача: строка «Верхняя задача» над кнопками статуса */
.parent-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: -12px 0 20px; padding: 10px 14px;
               background: var(--surface); border-left: 2px solid var(--accent); font-size: 13px; }
.parent-line .dim { font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; }
/* Чек-лист в форме новой задачи */
.cl-new { display: flex; flex-direction: column; gap: 6px; }
.cl-row { display: flex; align-items: center; gap: 8px; }
.cl-row input { flex: 1; }
#cl-add { margin-top: 8px; color: var(--accent-text); }

/* --- «Мой план» и канбан задач: цветные заголовки-стрелки (Э3, по образцу Битрикс24) ------------------- */
.kb.plan .kb-col, .plan-col { flex: 1 0 200px; }
.plan-col { background: transparent; border: 0; border-left: 1px dashed var(--line-art); min-height: 200px; }
.plan-col:first-child { border-left: 0; }
.plan-col.over { background: var(--surface); border-color: var(--line-art); }
.plan-head { --col: var(--plan-todo); --col-text: var(--plan-todo-text);
             display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 22px 0 14px; margin: 0 2px 0 0;
             background: var(--col); color: var(--col-text);
             /* стрелка вправо: прямоугольник со срезанным углом справа */
             clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); }
.plan-name { font-size: 13.5px; font-weight: 800; letter-spacing: -.1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-cnt { font-size: 12px; font-weight: 600; opacity: .85; }
.plan-head.st2 { --col: var(--plan-todo); --col-text: var(--plan-todo-text); }
.plan-head.st3 { --col: var(--plan-this_week); --col-text: var(--plan-this_week-text); }
.plan-head.st4 { --col: var(--plan-control); --col-text: var(--plan-control-text); }
.plan-head.st6 { --col: var(--plan-deferred); --col-text: var(--plan-deferred-text); }
.plan-add { display: block; text-align: center; font-size: 20px; line-height: 30px; color: var(--muted); border: 0; margin: 4px 8px 0; }
.plan-add:hover { color: var(--strong); background: var(--surface); }
.kb-more { display: block; text-align: center; font-size: 11px; color: var(--dim); border: 0; padding: 6px 0; }
.kb-more:hover { color: var(--strong); }

/* Сделки: заголовок колонки — цветная стрелка цвета стадии (Э3), шрифт прежний */
.kb-head.arrow { background: var(--stage); color: var(--stage-text); border: 0; padding-right: 22px; margin-right: 2px;
                 clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); }
.kb-head.arrow .kb-name, .kb-head.arrow .kb-meta { color: inherit; }
.kb-head.arrow .kb-meta { opacity: .85; }
.kb-head.arrow .kb-name { min-height: 46px; }   /* до 3 строк названия (колонки шире) — стрелки всех колонок одной высоты */
/* Закреплённые заголовки колонок досок (static/kam/sticky.js сдвигает их вслед за прокруткой) */
.kb-col > header { position: relative; z-index: 2; }
/* Шапка страницы с переключателем вида — без лишнего пустого места под ним (замечание 26.10.2026) */
.head:has(.view-switch) { margin-bottom: 14px; }
.head:has(.view-switch) + .tabs, .head:has(.view-switch) + * .tabs { margin-top: 0; }

/* --- Правки 26.10.2026 (вечер): стрелки без заливки, шире колонки воронки, быстрое завершение --------------- */
/* Стрелка — цветная рамка 2 px без заливки: наружная фигура цвета колонки, внутренняя (::before) — цвета фона,
   на 2 px меньше. Текст — обычный тёмный, жирный. Фон внутри (--head-fill) закрывает карточки под закреплённым заголовком. */
.plan-head, .kb-head.arrow { position: relative; isolation: isolate; color: var(--strong); }
.plan-head::before, .kb-head.arrow::before {
  content: ""; position: absolute; inset: 2px 3px 2px 2px; z-index: -1; background: var(--head-fill, var(--ground));
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 0 100%);
}
.plan-head { --col-text: var(--strong); }
.plan-head .plan-cnt { color: var(--muted); opacity: 1; }
.kb-head.arrow { --head-fill: var(--surface); color: var(--strong); }
.kb-head.arrow .kb-meta { color: var(--muted); opacity: 1; }
/* Колонки воронки сделок — в 1,5 раза шире (было 160 px): на широком экране делят ширину поровну, на узком — прокрутка */
#board[data-category] .kb-col { flex: 1 0 240px; }
/* Быстрая кнопка завершения на карточке задачи: круг с галочкой, при наведении — оранжевый */
.quick-done { margin-left: auto; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-art);
              background: var(--ground); cursor: pointer; padding: 0; position: relative; flex: 0 0 24px; }
.quick-done::after { content: ""; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px;
                     border: solid var(--dim); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.quick-done:hover { border-color: var(--accent); background: var(--accent); }
.quick-done:hover::after { border-color: var(--on-dark); }
.kb-foot .quick-done + .ava { margin-left: 0; }
/* Воронка сделок: заголовок компактнее — сумма сразу под названием, крупнее и тёмным цветом (замечание 26.10.2026).
   Высота названия — 2 строки: при ширине колонки 240 px названия стадий в них помещаются, стрелки одной высоты. */
.kb-head.arrow { padding-top: 8px; padding-bottom: 7px; }
.kb-head.arrow .kb-name { min-height: 31px; }
.kb-head.arrow .kb-meta { margin-top: 2px; font-size: 12.5px; font-weight: 700; color: var(--strong); }
.kb-head.arrow .kb-meta span:first-child { color: var(--muted); font-weight: 600; }   /* число сделок — приглушённо, акцент на сумме */

/* --- Шаблоны задач и типовые наборы (Э4) --- */
.warn-list.plain li { border-left-color: var(--hair); }                         /* чек-лист шаблона — без тревожной полосы */
.people-row { align-items: flex-start; }
.people-row > div { flex: 1; min-width: 260px; }
.people-more summary { margin: -6px 0 8px; cursor: pointer; }
.apply-tbl select { min-width: 200px; }
.apply-tbl tr.row-warn td { background: var(--warn-bg); }                       /* исполнителя надо выбрать вручную */
.warn-text { color: var(--warn); font-size: 11.5px; margin-top: 3px; }
.facts + .facts { border-top: 0; }
.set-pick .field { max-width: 480px; margin-bottom: 18px; }
.tpl-form .inline-form { align-items: flex-start; }                 /* поля с подсказками разной высоты — по верху */
.tpl-form .inline-form > .field:first-child select[name="responsible_role"] { min-width: 220px; }

/* --- Э6. Уведомления: колокольчик в шапке, список, раздел в профиле --------------------------------- */
.bell { position: relative; }
.bell > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; position: relative;
  color: var(--muted); padding: 4px; border-radius: 50%; }
.bell > summary::-webkit-details-marker { display: none; }
.bell > summary:hover, .bell[open] > summary { color: var(--strong); background: var(--surface); }
.bell-count { position: absolute; top: -3px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--accent); color: var(--on-light); font-size: 10px; font-weight: 800; line-height: 17px; text-align: center; }
.bell-count[data-count="0"] { display: none; }
.bell-panel { position: absolute; right: -10px; top: calc(100% + 10px); z-index: 20; width: 400px; max-width: calc(100vw - 24px);
  background: var(--ground); border: 1px solid var(--hair); box-shadow: var(--shadow); color: var(--text); font-size: 12.5px; }
.bell-panel > .dim { padding: 14px 16px; margin: 0; }
.bell-head, .bell-foot { display: flex; justify-content: space-between; align-items: center; padding: 11px 16px; }
.bell-head { border-bottom: 1px solid var(--hair); color: var(--strong); }
.bell-foot { border-top: 1px solid var(--hair); }
.bell-foot a { font-size: 11.5px; }
.bell-list { max-height: min(60vh, 520px); overflow-y: auto; }
.bell-empty { padding: 18px 16px; margin: 0; }
.ntf { display: flex; gap: 11px; padding: 11px 16px; border-bottom: 1px solid var(--hair); color: var(--text); }
.ntf:hover { background: var(--surface); color: var(--text); }
.ntf.unread { background: var(--surface2); box-shadow: inset 3px 0 0 var(--accent); }
.ntf .ava, .ntf-sys { flex: none; }
.ntf-sys { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--on-light); font-weight: 800; }
.ntf-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ntf-title { color: var(--strong); font-weight: 600; overflow-wrap: anywhere; }
.ntf.unread .ntf-title { font-weight: 700; }
.ntf-text { color: var(--text-soft); font-size: 12px; overflow-wrap: anywhere; }
.ntf-when { color: var(--dim); font-size: 11px; }
.ntf-list { border-top: 1px solid var(--hair); }
.ntf-list .ntf { padding-left: 12px; }
.push-box { margin-bottom: 14px; }
.push-box .btn-row { justify-content: flex-start; }
.push-devices { margin-bottom: 8px; }
.notify-prefs .tbl th.c, .notify-prefs .tbl td.c { text-align: center; width: 110px; }
.notify-prefs .tbl input[type=checkbox] { margin: 0; }
.notify-prefs .field.check { margin-top: 16px; }
h3.sub-rubric { margin: 22px 0 10px; }
@media (max-width: 720px) {
  .bell-panel { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; max-width: none; }
  .notify-prefs .tbl th.c, .notify-prefs .tbl td.c { width: 64px; }
}

/* --- Чаты (Э7, эскизы согласованы Александром 28.10.2026) ------------------------------------------
   Панель справа на всех страницах: страница сужается на ширину панели (--chat-w). Ширина развёрнутой
   панели --chat-w-open стоит на <body> (web/base.html), свёрнутой — --chat-strip. Уже 1280 px панель
   ложится поверх страницы, на телефоне (уже 760 px) её нет — кнопка «Чаты» и чаты на весь экран. */
:root { --chat-strip: 52px; }
body.chat-on { --chat-w: var(--chat-w-open, 380px); }
body.chat-on.chat-collapsed { --chat-w: var(--chat-strip); }
body.chat-on main, body.chat-on .foot { margin-right: var(--chat-w); }
body.chat-resizing { cursor: col-resize; user-select: none; }

.cp { position: fixed; right: 0; top: 77px; bottom: 0; width: var(--chat-w); z-index: 40; display: flex;
  background: var(--ground); border-left: 1px solid var(--hair); font-size: 13px; }
.cp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cp-main > [hidden] { display: none !important; }
body.chat-collapsed .cp-main, body.chat-collapsed .cp-grip { display: none; }
.cp-strip { display: none; }
body.chat-collapsed .cp-strip { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%;
  padding-top: 12px; background: var(--surface); overflow-y: auto; }

/* Ручка ширины — левый край панели */
.cp-grip { position: absolute; left: -5px; top: 0; bottom: 0; width: 10px; cursor: col-resize; z-index: 2; touch-action: none; }
.cp-grip::after { content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 2px; background: transparent; }
.cp-grip:hover::after, body.chat-resizing .cp-grip::after { background: var(--accent); }
.cp-grip span { position: absolute; left: -2px; top: 50%; width: 14px; height: 36px; margin-top: -18px;
  background: var(--ground); border: 1px solid var(--hair);
  background-image: radial-gradient(circle, var(--dim) 1px, transparent 1.4px); background-size: 4px 5px; background-position: center; }
.cp-grip:hover span { border-color: var(--accent); }

/* Шапка панели, вкладки, поиск */
.cp-listbox { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.cp-head { display: flex; align-items: center; gap: 6px; padding: 14px 14px 10px 18px; }
.cp-title { flex: 1; font-size: 10px; font-weight: 700; letter-spacing: 2.4px; text-transform: uppercase; color: var(--accent-text); }
.cp-ico { width: 28px; height: 28px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--hair); border-radius: 2px; background: var(--ground); color: var(--text-soft);
  font: inherit; font-size: 15px; line-height: 1; cursor: pointer; padding: 0; }
.cp-ico:hover { color: var(--strong); border-color: var(--dim); }
.cp-ico.on { color: var(--accent-text); border-color: var(--accent); }
.cp-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin: 0 14px 0 18px; border: 1px solid var(--hair); }
.cp-tab { padding: 8px 10px; background: none; border: 0; font: inherit; font-weight: 600; font-size: 12.5px;
  color: var(--muted); cursor: pointer; }
.cp-tab + .cp-tab { border-left: 1px solid var(--hair); }
.cp-tab.on { background: var(--strong); color: var(--ground); }
.cp-cnt, .nav-cnt { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; margin-left: 6px;
  background: var(--accent); color: var(--on-light); font-size: 10.5px; font-weight: 800; line-height: 18px; text-align: center; }
.cp-cnt.mute { background: var(--hair); color: var(--text-soft); }
.cp-cnt[hidden], .nav-cnt[hidden] { display: none; }
.nav-cnt { margin-left: 5px; }
/* input.cp-search — сильнее общего правила полей input[type=search] (ширина 100%) */
input.cp-search { width: calc(100% - 32px); margin: 10px 14px 6px 18px; padding: 7px 10px; border: 1px solid var(--hair); border-radius: 2px;
  background: var(--ground); color: var(--text); font: inherit; font-size: 12.5px; }
.cp-search:focus { outline: none; border-color: var(--accent); }
.cp-body { flex: 1; overflow-y: auto; padding-bottom: 14px; }

/* Строки списка */
.cp-grp { padding: 12px 18px 4px; font-size: 9.5px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; color: var(--dim); }
.cp-row { display: flex; gap: 10px; align-items: center; padding: 8px 14px 8px 18px; color: var(--text); border: 0; }
.cp-row:hover { background: var(--surface); color: var(--text); }
.cp-row.sel { background: var(--surface2); box-shadow: inset 3px 0 0 var(--accent); }
.cp-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cp-nm { display: flex; justify-content: space-between; gap: 8px; }
.cp-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--strong); }
.cp-t small { color: var(--dim); font-weight: 400; }
.cp-mute { color: var(--dim); vertical-align: -1px; }
.cp-time { flex: none; font-size: 11px; color: var(--note); }
.cp-pj { margin: 1px 0; font-size: 10.5px; font-weight: 700; letter-spacing: .3px; color: var(--accent-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-pv { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.cp-pv-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-row.has-unread .cp-pv-t { color: var(--text); }
.cp-found { white-space: normal; }
.cp-empty, .cp-note { padding: 14px 18px; margin: 0; color: var(--note); font-size: 12px; }
.cp-note { text-align: center; }

/* Значки чатов */
.cp-av { position: relative; flex: none; display: inline-flex; }
.cp-av .ava { width: 34px; height: 34px; }
.cp-online { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--ok); border: 2px solid var(--ground); }
.cp-badge { flex: none; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; text-align: center;
  border-radius: 2px; font-size: 9.5px; font-weight: 800; line-height: 1.15; letter-spacing: .3px; }
.cp-badge.company, .cp-badge.team { background: var(--strong); color: var(--ground); }
.cp-badge.customer { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); }

/* Свёрнутая полоса */
.cp-strip-total { min-width: 22px; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--accent);
  color: var(--on-light); font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
.cp-strip-total[hidden] { display: none; }
.cp-strip-label { writing-mode: vertical-rl; transform: rotate(180deg); cursor: pointer;
  font-size: 10px; font-weight: 700; letter-spacing: 2.4px; text-transform: uppercase; color: var(--accent-text); }
.cp-strip-sep { width: 24px; border-top: 1px solid var(--hair); }
.cp-strip-items { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-bottom: 16px; }
.cp-strip-item { position: relative; width: 34px; height: 34px; border-radius: 2px; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-size: 10px; font-weight: 800; background: var(--strong); color: var(--ground); }
.cp-strip-item.direct { border-radius: 50%; background: var(--surface2); color: var(--text-soft); border: 1px solid var(--hair); }
.cp-strip-item.customer { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); }
.cp-strip-n { position: absolute; right: -11px; top: -11px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--accent); color: var(--on-light); font-size: 10px; line-height: 17px; border: 2px solid var(--surface); box-sizing: content-box; }

/* Открытый чат */
.cp-chat { flex: 1; min-height: 0; display: flex; }
.cc { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; }
.cc.drop { outline: 2px dashed var(--accent); outline-offset: -6px; }
.cc-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--hair); }
.cc-back { flex: none; width: 24px; height: 28px; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; }
.cc-back:hover { color: var(--strong); }
.cc-page .cc-back { display: none; }
.cc-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cc-t b { color: var(--strong); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-t small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 14px 10px 18px; display: flex; flex-direction: column; gap: 10px; }
.cc-msgs > :first-child { margin-top: auto; }   /* мало сообщений — прижаты к полю ввода */
.cc-more { align-self: center; background: none; border: 1px solid var(--hair); border-radius: 2px; padding: 5px 12px;
  font: inherit; font-size: 11.5px; color: var(--muted); cursor: pointer; }
.cc-empty, .cc-placeholder { color: var(--note); text-align: center; font-size: 12px; padding: 24px 12px; margin: auto 0 0; }
.cc-placeholder { margin: auto; }
.cc-day { text-align: center; font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--note); margin: 6px 0 0; }
.cc-m { display: flex; gap: 8px; align-items: flex-start; }
.cc-m.own { justify-content: flex-end; }
.cc-m.flash .cc-bd { box-shadow: 0 0 0 2px var(--accent); }
.cc-av .ava { width: 28px; height: 28px; }
.cc-bd { position: relative; max-width: 88%; min-width: 0; padding: 7px 10px; border-radius: 2px; background: var(--surface); }
.cc-m.own .cc-bd { background: var(--own-bg); }
.cc-who { font-size: 11px; font-weight: 700; color: var(--strong); }
.cc-who small { font-weight: 400; color: var(--muted); }
.cc-tm { margin-left: 6px; font-weight: 400; color: var(--note); }
.cc-tx { color: var(--text); line-height: 1.45; overflow-wrap: anywhere; }
.cc-tx a { color: var(--accent-text); }
.cc-gone { color: var(--note); font-style: italic; }
.mention { color: var(--accent-text); font-weight: 700; }
.cc-quote { display: block; margin: 3px 0 5px; padding: 2px 8px; border: 0; border-left: 2px solid var(--accent);
  background: var(--ground); color: var(--muted); font-size: 11.5px; overflow-wrap: anywhere; }
.cc-quote b { display: block; font-size: 10.5px; color: var(--text-soft); }
.cc-file { display: flex; gap: 8px; align-items: center; margin-top: 5px; padding: 6px 8px; border: 1px solid var(--hair);
  background: var(--ground); color: var(--text); overflow-wrap: anywhere; }
.cc-file small { display: block; color: var(--note); font-size: 10.5px; }
.cc-ext { flex: none; padding: 3px 4px; border-radius: 2px; background: var(--bad); color: var(--on-dark); font-size: 9px; font-weight: 800; }
.cc-img { display: block; margin-top: 5px; border: 0; }
.cc-img img { display: block; max-width: 100%; max-height: 220px; border: 1px solid var(--hair); }
.cc-meta { text-align: right; font-size: 10.5px; color: var(--note); }
.cc-meta:empty { display: none; }
.cc-read.on { color: var(--ok); }
.cc-acts { display: none; position: absolute; top: -12px; right: 6px; background: var(--ground); border: 1px solid var(--hair); }
.cc-m:hover .cc-acts { display: flex; }
.cc-acts button { background: none; border: 0; padding: 2px 8px; font: inherit; font-size: 11px; color: var(--muted); cursor: pointer; }
.cc-acts button:hover { color: var(--accent-text); }

/* Поле ввода */
.cc-input { position: relative; border-top: 1px solid var(--hair); padding: 10px 14px 10px 18px; margin: 0; }
.cc-reply { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; padding-left: 8px; border-left: 2px solid var(--accent);
  font-size: 11.5px; color: var(--muted); }
.cc-reply[hidden], .cc-files[hidden], .cc-error[hidden], .cc-mention[hidden] { display: none; }
.cc-reply-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-reply-t b { color: var(--text-soft); }
.cc-reply button, .cc-chip button { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; }
.cc-files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.cc-chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 8px; background: var(--surface2); font-size: 11.5px; }
.cc-box { display: flex; gap: 6px; align-items: flex-end; }
.cc-box textarea { flex: 1; min-height: 36px; max-height: 160px; resize: none; padding: 8px 10px; border: 1px solid var(--hair);
  border-radius: 2px; background: var(--ground); color: var(--text); font: inherit; line-height: 1.4; }
.cc-box textarea:focus { outline: none; border-color: var(--accent); }
.cc-send { flex: none; height: 36px; width: 44px; border: 0; border-radius: 2px; background: var(--accent); color: var(--on-light); cursor: pointer; }
.cc-send:hover { background: var(--accent-hover); }
.cc-send[disabled] { opacity: .55; cursor: wait; }
.cc-tools { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.cc-tool { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 3px;
  text-transform: none; letter-spacing: 0; font-weight: 400; margin: 0; }
.cc-tool:hover { color: var(--accent-text); }
.cc-hint { color: var(--note); }
.cc-error { margin-top: 6px; font-size: 11.5px; color: var(--bad-text); }
.cc-mention { position: absolute; left: 18px; right: 14px; bottom: calc(100% + 4px); z-index: 5; max-height: 260px; overflow-y: auto;
  background: var(--ground); border: 1px solid var(--hair); box-shadow: var(--shadow); }
.cc-mention button { display: block; width: 100%; text-align: left; padding: 7px 10px; background: none; border: 0; font: inherit; color: var(--text); cursor: pointer; }
.cc-mention button.sel, .cc-mention button:hover { background: var(--surface2); }
.cc-mention small { color: var(--note); }

/* Обсуждение в карточке задачи */
.chat-inline { border: 1px solid var(--hair); display: flex; min-height: 200px; max-height: 520px; }
.cc-inline .cc-msgs { padding-top: 12px; }

/* Страница «Чаты» во всю ширину */
.chat-page { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; height: calc(100vh - 230px); min-height: 480px;
  border: 1px solid var(--hair); }

.chat-page-main { display: flex; min-width: 0; min-height: 0; }

/* Кнопка «Чаты» на телефоне */
.chat-fab { display: none; position: fixed; right: 16px; bottom: 18px; z-index: 50; height: 48px; padding: 0 16px; align-items: center; gap: 8px;
  border: 0; border-radius: 24px; background: var(--strong); color: var(--ground); font: inherit; font-weight: 700; box-shadow: var(--shadow); cursor: pointer; }
.chat-fab .cp-cnt { margin-left: 0; }

/* Узкий экран: развёрнутая панель — поверх страницы, страница сужается только на полосу */
@media (max-width: 1279px) {
  body.chat-on main, body.chat-on .foot { margin-right: var(--chat-strip); }
  body.chat-on:not(.chat-collapsed) .cp { box-shadow: var(--shadow); }
}
/* Телефон: панели нет, кнопка «Чаты»; открытые чаты — на весь экран */
@media (max-width: 759px) {
  body.chat-on main, body.chat-on .foot { margin-right: 0; }
  .cp { display: none; }
  body.chat-on .chat-fab { display: flex; }
  body.chat-mobile-open { overflow: hidden; }
  body.chat-mobile-open .cp { display: flex; left: 0; width: 100%; top: 0 !important; z-index: 90; box-shadow: none; }
  body.chat-mobile-open .cp-main { display: flex; }
  body.chat-mobile-open .cp-strip, body.chat-mobile-open .cp-grip, body.chat-mobile-open .chat-fab { display: none; }
  .cc-hint { display: none; }
  .chat-page { grid-template-columns: 1fr; height: calc(100vh - 170px); }
  .chat-page.has-open .cp-listbox, .chat-page:not(.has-open) .chat-page-main { display: none; }
  .chat-page .cp-listbox { border-right: 0; }
  .cc-page .cc-back { display: inline-block; }
  .cc-acts { position: static; display: flex; margin-top: 4px; border: 0; background: none; }
  .cc-acts button { padding: 2px 8px 2px 0; }
}

/* Чаты — замечания Александра 28.10.2026: ★ избранное, закрепление, удаление с выбором */
.cp-row { position: relative; }
.cp-row-acts { display: none; position: absolute; right: 12px; top: 6px; gap: 2px; background: var(--ground); border: 1px solid var(--hair); }
.cp-row:hover .cp-row-acts { display: flex; }
.cp-row-acts button { width: 24px; height: 22px; padding: 0; border: 0; background: none; color: var(--dim); cursor: pointer; font: inherit; font-size: 13px; }
.cp-row-acts button:hover, .cp-row-acts button.on { color: var(--accent-text); }
.cp-star-mark, .cp-star-ico { color: var(--accent); }
.cp-pin-mark { color: var(--dim); vertical-align: -1px; }
.cp-row.pinned { cursor: grab; }
.cp-row.dragging { opacity: .45; }
.cc-star { font-size: 14px; }
.cc-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--hair);
  background: var(--warn-bg); font-size: 12.5px; }
.cc-confirm[hidden] { display: none; }
.cc-confirm small { flex-basis: 100%; color: var(--muted); }
.danger-btn { background: var(--bad); color: var(--on-dark); }
.danger-btn:hover { background: var(--bad-text); color: var(--on-dark); }
.cc-delbox { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--hair);
  font-size: 11.5px; color: var(--muted); }
.cc-delbox[hidden] { display: none; }
.cc-delbox button { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-text); cursor: pointer; font-weight: 600; }
.cc-delbox button[data-act="del-cancel"] { color: var(--muted); font-weight: 400; }
.cc-hint a { color: var(--note); }
.radio-line { display: flex; gap: 8px; align-items: center; margin: 6px 0; text-transform: none; letter-spacing: 0;
  font-size: 13px; font-weight: 400; color: var(--text); }
.radio-line input { width: auto; margin: 0; }
@media (max-width: 759px) { .cp-row-acts { display: none !important; } }
.cc-star-mark { color: var(--accent); flex: none; }
.cc-menu { position: relative; flex: none; }
.cc-menu > summary { list-style: none; }
.cc-menu > summary::-webkit-details-marker { display: none; }
.cc-menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 10; min-width: 230px; display: flex; flex-direction: column;
  background: var(--ground); border: 1px solid var(--hair); box-shadow: var(--shadow); }
.cc-menu-list button { text-align: left; padding: 8px 12px; background: none; border: 0; font: inherit; font-size: 12.5px; color: var(--text); cursor: pointer; }
.cc-menu-list button:hover { background: var(--surface2); }
.cc-menu-list button.danger { color: var(--bad-text); border-top: 1px solid var(--hair); }

/* Чаты — работа с сообщениями «как в Б24» (замечания Александра 28.10.2026) */
.cc-pinned { display: flex; align-items: stretch; border-bottom: 1px solid var(--hair); background: var(--surface); }
.cc-pinned[hidden] { display: none; }
.cc-pin-item { display: none; flex: 1; min-width: 0; gap: 8px; align-items: flex-start; padding: 7px 14px; border: 0; border-left: 3px solid var(--accent);
  background: none; text-align: left; font: inherit; font-size: 12px; color: var(--text); cursor: pointer; }
.cc-pin-item.on { display: flex; }
.cc-pin-item svg { flex: none; margin-top: 3px; color: var(--accent-text); }
.cc-pin-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-pin-t b { display: block; font-size: 10.5px; color: var(--accent-text); }
.cc-pin-next { flex: none; width: 34px; border: 0; border-left: 1px solid var(--hair); background: none; color: var(--muted); cursor: pointer; }
.cc-fwd { font-size: 11px; color: var(--accent-text); margin-bottom: 2px; }
.cc-fav-mark { color: var(--accent); }
.cc-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.cc-react { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 11px; border: 1px solid var(--hair);
  background: var(--ground); font: inherit; font-size: 12px; color: var(--text-soft); cursor: pointer; }
.cc-react.mine { border-color: var(--accent); background: var(--own-bg); color: var(--accent-text); }
.cc-react span { font-size: 11px; font-weight: 700; }
.cc-acts button[data-act="menu"] { font-size: 14px; line-height: 1; padding: 2px 9px; }
.cc-msgmenu { position: absolute; z-index: 20; width: 250px; background: var(--ground); border: 1px solid var(--hair); box-shadow: var(--shadow);
  display: flex; flex-direction: column; max-height: 80%; overflow-y: auto; }
.cc-menu-reacts { display: flex; justify-content: space-between; padding: 6px 8px; border-bottom: 1px solid var(--hair); }
.cc-menu-reacts button { border: 0; background: none; font-size: 19px; line-height: 1; padding: 3px; cursor: pointer; border-radius: 50%; }
.cc-menu-reacts button:hover { background: var(--surface2); }
.cc-menu-reacts button[data-act="m-react-more"] { font-size: 12px; color: var(--muted); }
.cc-menu-emoji { max-height: 220px; overflow-y: auto; border-bottom: 1px solid var(--hair); padding: 4px 6px; }
.cc-menu-emoji[hidden] { display: none; }
.cc-menu-item { text-align: left; padding: 8px 14px; border: 0; background: none; font: inherit; font-size: 12.5px; color: var(--text); cursor: pointer; }
.cc-menu-item:hover { background: var(--surface2); }
.cc-menu-item.danger { color: var(--bad-text); border-top: 1px solid var(--hair); }
.cc-emoji-grp { font-size: 9.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--dim); padding: 6px 2px 2px; }
.cc-emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); }
.cc-emoji-grid button { border: 0; background: none; font-size: 19px; padding: 3px; cursor: pointer; border-radius: 2px; }
.cc-emoji-grid button:hover { background: var(--surface2); }
.cc-pop { position: absolute; left: 18px; right: 14px; bottom: calc(100% + 4px); z-index: 6; max-height: 300px; overflow-y: auto; padding: 6px 8px;
  background: var(--ground); border: 1px solid var(--hair); box-shadow: var(--shadow); }
.cc-pop[hidden] { display: none; }
.cc-gifs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.cc-gifs button { border: 1px solid var(--hair); background: var(--surface); padding: 0; cursor: pointer; height: 90px; }
.cc-gifs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cc-gifs .cp-empty { grid-column: 1 / -1; }
.cc-error.ok { color: var(--ok); }
/* «Выбрать» */
.cc-pick { display: none; flex: none; width: 18px; height: 18px; margin-top: 6px; border: 1.5px solid var(--dim); border-radius: 50%; }
.cc.selecting .cc-pick { display: inline-block; }
.cc.selecting .cc-m { cursor: pointer; }
.cc.selecting .cc-m.own { justify-content: flex-start; }
.cc.selecting .cc-m.own .cc-bd { margin-left: auto; }
.cc-m.picked .cc-pick { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--ground); }
.cc-m.picked .cc-bd { box-shadow: 0 0 0 1px var(--accent); }
.cc.selecting .cc-acts { display: none !important; }
.cc-selbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px 12px 18px; border-top: 1px solid var(--hair); font-size: 12.5px; }
.cc-selbar[hidden], .cc-input[hidden] { display: none; }
.cc-selbar [data-sel-count] { font-weight: 700; margin-right: auto; }
/* Окно «Переслать» */
.fwd-back { position: fixed; inset: 0; z-index: 120; background: rgba(0, 0, 0, .35); display: flex; align-items: center; justify-content: center; }
.fwd-back[hidden] { display: none; }
.fwd { width: 420px; max-width: calc(100vw - 24px); max-height: 80vh; display: flex; flex-direction: column; background: var(--ground);
  border: 1px solid var(--hair); box-shadow: var(--shadow); }
.fwd-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px 0 18px; color: var(--strong); }
.fwd-list { overflow-y: auto; padding-bottom: 8px; }
button.cp-row { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
/* Боковая панель на странице «Чаты» */
.chat-page.has-info { grid-template-columns: minmax(300px, 380px) 1fr minmax(280px, 340px); }
.chat-page-info { border-left: 1px solid var(--hair); min-height: 0; display: flex; }
.chat-page-info[hidden] { display: none; }
.ci { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.ci-tabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 10px 10px 0; border-bottom: 1px solid var(--hair); }
.ci-tabs button { border: 0; border-bottom: 2px solid transparent; background: none; font: inherit; font-size: 12px; color: var(--muted); padding: 6px 7px; cursor: pointer; }
.ci-tabs button.on { color: var(--strong); border-bottom-color: var(--accent); }
.ci-tabs .ci-close { margin-left: auto; }
.ci-body { flex: 1; overflow-y: auto; padding-bottom: 12px; }
input.ci-q { width: calc(100% - 24px); margin: 10px 12px; }
.ci-msg { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--hair); background: none; font: inherit; padding: 8px 12px; cursor: pointer; color: var(--text); }
.ci-msg:hover { background: var(--surface); }
.ci-msg small { color: var(--note); }
.ci-msg span { display: block; font-size: 12px; color: var(--text-soft); overflow-wrap: anywhere; }
.ci-file, .ci-link { padding: 6px 12px; border-bottom: 1px solid var(--hair); font-size: 12px; overflow-wrap: anywhere; }
.ci-file .linkbtn, .ci-link .linkbtn { font-size: 11px; }
.ci-link a { display: block; color: var(--accent-text); }
.ci-person { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 12px; text-align: center; }
.ci-person .ava { width: 72px; height: 72px; }
.ci-person span, .ci-sub { color: var(--muted); font-size: 12px; }
.ci-sub { padding: 10px 12px 4px; margin: 0; }
.ci-member { display: flex; gap: 8px; align-items: center; padding: 6px 12px; font-size: 12.5px; }
.ci-member small { display: block; color: var(--note); font-size: 11px; }
.ci .props { padding: 0 12px; }
@media (max-width: 1279px) { .chat-page.has-info { grid-template-columns: minmax(260px, 320px) 1fr; } .chat-page.has-info .chat-page-side { display: none; } }
@media (max-width: 759px) { .chat-page.has-info .chat-page-main { display: none; } .chat-page.has-info { grid-template-columns: 1fr; } }

/* --- Полосы прокрутки (Э7, замечание Александра 28.10.2026): тонкие, как в Telegram ---------------------
   Обычно не видны; появляются при прокрутке (класс is-scrolling — static/kam/scrollbars.js) и пока мышь над блоком. */
* { scrollbar-width: thin; scrollbar-color: transparent transparent; transition: scrollbar-color .25s; }
*:not(html):hover, .is-scrolling { scrollbar-color: var(--scroll-thumb) transparent; }

/* Чаты — замечания 28.10.2026 (вторая проверка): крупные смайлики, быстрый лайк, панели смайликов и GIF */
.cc-tx { font-size: 14px; }
.emj { font-size: 1.35em; line-height: 1; vertical-align: -0.12em; }
.cc-tx.jumbo .emj { font-size: 2.7em; line-height: 1.15; }
.cc-tx.jumbo { padding: 2px 0; }
.cc-bd { position: relative; }
.cc-like { position: absolute; bottom: 2px; right: -30px; width: 26px; height: 26px; display: none; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: var(--ground); color: var(--dim); cursor: pointer; padding: 0; }
.cc-m.own .cc-like { right: auto; left: -30px; }
.cc-m:hover .cc-like { display: inline-flex; }
.cc-like:hover { color: var(--accent-text); background: var(--surface2); }
.cc.selecting .cc-like { display: none !important; }
.cc-msgmenu { overflow: visible; max-height: none; }
.cc-menu-emoji { position: absolute; top: 44px; bottom: 0; left: 0; z-index: 2; max-height: none; overflow-y: auto;
  background: var(--ground); border: 1px solid var(--hair); box-shadow: var(--shadow); padding: 4px 8px; }
.cc-menu-emoji .cc-emoji-grid { grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); }
.cc-emoji-grid button { font-size: 22px; }
.cc-pop-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 0 6px; color: var(--strong); }
input.cc-gif-q { width: 100%; margin: 0 0 8px; }
.cc-pop[data-kind="gif"] { max-height: 380px; }
.cc-gifs img { background: var(--surface2); }
.cc-gif-more { grid-column: 1 / -1; height: 1px; }
/* Страница «Чаты»: заголовок как в «Сделках», высота по окну, без подвала */
.chat-page-head { margin-bottom: 14px; }
.chat-page .cp-head { display: none; }   /* «Новый личный чат» — кнопка в заголовке страницы */
.chat-page .cp-tabs { margin-top: 14px; }
main:has(.chat-page) { padding-bottom: 0; }
body:has(.chat-page) .foot { display: none; }
@media (max-width: 759px) { .cc-like { display: none !important; } }

/* Кнопки берут шрифт программы (с Noto Color Emoji), а не системный шрифт браузера —
   иначе смайлики в панелях выглядят как в Windows, а новые не показываются вовсе (замечание 28.10.2026). */
button { font-family: inherit; }
.cc-emoji-grid button, .cc-menu-reacts button, .cc-react, .cc-like, .cp-strip-item { font-family: var(--font); }
.cc-gif-note { margin: 8px 0 0; font-size: 11.5px; color: var(--note); }

/* Замечание 28.10.2026 (третья проверка): окно чата во всю высоту страницы — заголовок «Чаты» только над списком;
   кнопки сообщения появляются при наведении на само облачко, плавно. */
.chat-page { border: 0; }
.chat-page-side { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-page-side .chat-page-head { margin-bottom: 12px; }
/* Линия между списком и чатом — у окна чата, сплошная во всю высоту (замечание 28.10.2026); у списка правой линии нет */
.chat-page-side .cp-listbox { flex: 1; min-height: 0; border: 1px solid var(--hair); border-right: 0; }
.chat-page-main { border: 1px solid var(--hair); }
.chat-page-info { border: 1px solid var(--hair); border-left: 0; }
.cc-m .cc-acts, .cc-m .cc-like { display: flex; opacity: 0; visibility: hidden; transition: opacity .18s ease, visibility .18s; }
.cc-m .cc-like { display: inline-flex; }
.cc-m:hover .cc-acts, .cc-m:hover .cc-like { opacity: 0; visibility: hidden; }
.cc-bd:hover .cc-acts, .cc-bd:hover .cc-like, .cc-bd:focus-within .cc-acts { opacity: 1; visibility: visible; }
@media (max-width: 759px) {
  .chat-page.has-open .chat-page-side, .chat-page:not(.has-open) .chat-page-main { display: none; }
  .chat-page-main { border-left: 1px solid var(--hair); }
  .cc-m .cc-acts { opacity: 1; visibility: visible; }
}
.cc-msgs { padding-top: 18px; }   /* место для плашки «Ответить ⋯» у верхнего сообщения */
/* Окно чата — вплотную к шапке, как боковая панель чатов (замечание 28.10.2026): у страницы нет верхнего отступа,
   он остаётся только у заголовка над списком; верхняя линия окна — линия шапки. */
main:has(.chat-page) { padding-top: 0; }
.chat-page-side { padding-top: 18px; }
.chat-page-main, .chat-page-info { border-top: 0; }

/* Кнопка «Отправить» — стрелка вверх, как в VS Code (замечание 28.10.2026): по центру, крупнее */
.cc-send { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 36px; padding: 0; border-radius: 4px; color: var(--on-dark); }

/* «Печатает…» с бегущим троеточием (замечание Александра 30.10.2026) */
.cc-typing { display: flex; align-items: center; gap: 4px; padding: 0 18px 4px; font-size: 11.5px; color: var(--accent-text); }
.cc-typing[hidden] { display: none; }
.cc-dots { display: inline-flex; gap: 3px; margin-left: 2px; }
.cc-dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .25; animation: cc-dot 1.2s infinite ease-in-out; }
.cc-dots i:nth-child(2) { animation-delay: .2s; }
.cc-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes cc-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* Страница «Чаты» на телефоне — во весь экран: без полей по бокам и боковых рамок (замечание 30.10.2026) */
@media (max-width: 759px) {
  main:has(.chat-page) > .wrap { padding-left: 0; padding-right: 0; }
  .chat-page-side { padding: 12px 12px 0; }
  .chat-page-side .cp-listbox { border-left: 0; border-right: 0; }
  .chat-page-main, .chat-page-info { border-left: 0; border-right: 0; border-bottom: 0; }
  .chat-page.has-open .chat-page-head { display: none; }
}

/* Быстрый лайк не вылезает за край чата, горизонтальной прокрутки в переписке нет (замечание 30.10.2026):
   облачку оставляем место под кнопку лайка (26 px + отступ) — у чужих справа, у своих слева. */
.cc-msgs { overflow-x: hidden; }
.cc-m .cc-bd { max-width: calc(100% - 72px); }      /* чужое: аватар 28 + зазор 8 + лайк 36 */
.cc-m.own .cc-bd { max-width: calc(100% - 36px); }  /* своё: только лайк слева */
.cc-m .cc-like { right: -32px; }
.cc-m.own .cc-like { left: -32px; right: auto; }
.cc.selecting .cc-m .cc-bd { max-width: calc(100% - 100px); }   /* в режиме «Выбрать» ещё кружок-галочка */
@media (max-width: 759px) { .cc-m .cc-bd, .cc-m.own .cc-bd { max-width: calc(100% - 36px); } }
/* --- Лента (Э8) ------------------------------------------------------------------------------------
   Карточки объявлений одной колонкой: текст читается строкой не шире ~860 px даже на широком экране.
   Важное неподтверждённое — оранжевый рант слева, закреплённое — тонкая оранжевая линия сверху. */
.feed { max-width: 860px; }
.compose { border: 1px solid var(--hair); margin-bottom: 18px; }
.compose > summary { list-style: none; cursor: pointer; padding: 14px 18px; color: var(--muted); font-size: 13.5px; }
.compose > summary::-webkit-details-marker { display: none; }
.compose[open] > summary { border-bottom: 1px solid var(--hair); color: var(--strong); font-weight: 600; }
.compose > form { padding: 18px; }
.feed-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 20px; align-items: end; }
.people-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; }
.people-checks label, .inline-check { display: inline-flex; align-items: center; font-size: 13px; font-weight: 400;
  letter-spacing: 0; text-transform: none; color: var(--text); margin: 0; cursor: pointer; }
.poll-build { border-top: 1px solid var(--hair); padding-top: 14px; margin-top: 4px; }
.poll-block { border-left: 2px solid var(--accent); padding: 4px 0 4px 14px; margin-bottom: 14px; }
.poll-block .field { margin-bottom: 10px; }
.poll-block-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.feed-tabs { margin-bottom: 14px; }

.post { border: 1px solid var(--hair); padding: 18px 20px 14px; margin-bottom: 16px; background: var(--bg); }
.post.pinned { border-top: 2px solid var(--accent); }
.post.must { border-left: 3px solid var(--accent); }
.post-h { display: flex; align-items: flex-start; gap: 12px; }
.post-who { flex: 1; min-width: 0; line-height: 1.45; }
.post-who b { color: var(--strong); font-size: 13.5px; }
.post-who .dim { display: block; font-size: 11.5px; }
.post-who .dim a { color: inherit; border-bottom-color: var(--hair); }
.post-tags { display: flex; gap: 6px; align-items: center; }
.post-menu > summary { list-style: none; font-size: 18px; line-height: 1; padding: 0 4px; }
.post-menu > summary::-webkit-details-marker { display: none; }
.post-menu .menu { left: auto; right: 0; min-width: 190px; }
.post-menu .menu form { margin: 0; }
.post-menu .menu button { display: block; width: 100%; text-align: left; padding: 10px 16px; font: inherit; font-size: 13px;
  background: none; border: 0; color: var(--text); cursor: pointer; }
.post-menu .menu button:hover { background: var(--surface); color: var(--strong); }
.post-menu .menu button.danger { color: var(--bad); }
.post-title { font-size: 17px; font-weight: 700; color: var(--strong); margin: 14px 0 6px; }
.post-text { font-size: 14px; line-height: 1.6; margin-top: 10px; overflow-wrap: anywhere; }
.post-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; list-style: none; padding: 0; }
.post-img img { display: block; max-height: 260px; max-width: 100%; border: 1px solid var(--hair); }
.post-img.sm img { max-height: 120px; }
.post-file { display: inline-block; padding: 6px 10px; border: 1px solid var(--hair); font-size: 12.5px; }

.poll { margin-top: 14px; padding: 14px 16px; background: var(--surface); }
.poll-q + .poll-q { margin-top: 14px; }
.poll-q-t { font-weight: 700; color: var(--strong); margin-bottom: 8px; }
.poll-opt { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 400; letter-spacing: 0;
  text-transform: none; color: var(--text); margin: 0 0 6px; cursor: pointer; }
.poll-opt input[type=radio] { accent-color: var(--accent); margin: 0 8px 0 0; }
.poll-res { margin-bottom: 8px; }
.poll-res-t { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.poll-res.mine .poll-res-t span:first-child { color: var(--accent-text); font-weight: 700; }
.poll-res .bar { margin-top: 4px; }
.poll-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; }
.poll > .linkbtn { margin-top: 8px; }

.post-read { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; font-size: 12.5px; }
.reads { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 30px; margin-top: 12px;
  padding: 14px 16px; background: var(--surface); }
.reads-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12.5px; }
.reads .btn { margin-top: 10px; }

.post-bar { display: flex; align-items: center; gap: 18px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--hair); font-size: 12px; }
.like { background: none; border: 1px solid var(--hair); border-radius: 2px; padding: 4px 10px; font: inherit; font-size: 12px;
  color: var(--muted); cursor: pointer; }
.like:hover { border-color: var(--dim); color: var(--strong); }
.like.on { border-color: var(--accent); color: var(--accent-text); }
.like .emj { font-size: 1.1em; }
.linkbtn.on { color: var(--accent-text); font-weight: 700; }

.comments { margin-top: 8px; }
.comments > .linkbtn { margin: 4px 0 6px; }
.comment { display: flex; gap: 10px; padding: 8px 0; }
.comment-body { flex: 1; min-width: 0; }
.comment-h { font-size: 12px; }
.comment-h b { color: var(--strong); }
.comment-text { font-size: 13.5px; line-height: 1.55; margin-top: 2px; overflow-wrap: anywhere; }
.comment-actions { display: flex; gap: 14px; margin-top: 4px; }
.comment-form { margin-top: 6px; }
.comment-form textarea { min-height: 38px; resize: none; }
.comment-form.new { display: flex; align-items: flex-end; gap: 8px; }
.comment-form.new textarea { flex: 1; }
.comment-file { cursor: pointer; font-size: 17px; letter-spacing: 0; text-transform: none; margin: 0 0 8px; color: var(--muted); position: relative; }
.comment-file[data-count]:not([data-count=""])::after { content: attr(data-count); position: absolute; top: -6px; right: -8px;
  font-size: 9px; font-weight: 700; color: var(--accent-text); }

.mention-pop { position: absolute; z-index: 60; min-width: 220px; background: var(--ground); border: 1px solid var(--hair);
  box-shadow: var(--shadow); padding: 4px 0; }
.mention-pop div { padding: 7px 14px; font-size: 13px; cursor: pointer; }
.mention-pop div.sel, .mention-pop div:hover { background: var(--surface); color: var(--strong); }
.feed-more { display: block; margin: 0 auto 20px; }

/* Главная «Требует ознакомления» и «Лента проекта» в карточке проекта — строки со ссылкой */
.to-read-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--hair); }
.to-read-row > a { font-weight: 600; color: var(--strong); }
.to-read-row .dim { font-size: 11.5px; flex: 1; }
.to-read-row form { margin: 0; }
@media (max-width: 720px) {
  .post { padding: 14px 12px 10px; }
  .comment-form.new .ava { display: none; }
}
/* Э8 (замечание 30.10.2026): смайлики и GIF у комментария и в форме объявления — панели как в чатах (.cc-pop) */
.comment-form.new, .emo-bar { position: relative; }
.cf-btn { background: none; border: 1px solid transparent; border-radius: 2px; padding: 3px 6px; margin-bottom: 6px; font: inherit;
  font-size: 12px; color: var(--muted); cursor: pointer; }
.cf-btn:hover { border-color: var(--hair); color: var(--strong); }
.cf-btn .emj { font-size: 1.35em; }
.cf-btn.gif { font-weight: 800; font-size: 10.5px; letter-spacing: .5px; border-color: var(--hair); }
.feed-pop { left: 0; right: 0; background: var(--ground); border: 1px solid var(--hair); box-shadow: var(--shadow); }
.emo-bar { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.emo-bar .cf-btn { margin: 0; }
.emo-bar .feed-pop { bottom: calc(100% + 4px); }
.gif-chosen { display: inline-flex; align-items: center; gap: 6px; }
.gif-chosen img { height: 48px; border: 1px solid var(--hair); }
.comment-text.jumbo .emj { font-size: 2.4em; line-height: 1.15; }   /* комментарий из 1–3 смайликов — крупно, как в чатах */
/* Строка нового комментария (замечание Александра 30.10.2026): аватар, поле и кнопки — по центру строки,
   без отступов снизу у отдельных кнопок (раньше «плясали» по высоте). Кнопки одной высоты — 30 px. */
.comment-form.new { align-items: center; }
.comment-form.new > .ava, .comment-form.new > .cf-btn, .comment-form.new > .comment-file { margin: 0; flex: none; }
.comment-form.new > .cf-btn, .comment-form.new > .comment-file { height: 30px; min-width: 30px; display: inline-flex;
  align-items: center; justify-content: center; padding: 0 6px; line-height: 1; }
.comment-form.new > .btn { flex: none; height: 30px; display: inline-flex; align-items: center; }
.comment-form.new textarea { margin: 0; }

/* ================================================================================================
   Э9. Календарь: слои слева, сетка месяца / недели, день, список; карточка и форма события; отсутствия.
   Цвет строки — переменная --c (слой или выбранный цвет), фон — её бледный оттенок.
   ================================================================================================ */
.ev-my, .lay-my { --c: var(--ev-orange); }
.ev-company, .lay-company { --c: var(--ev-blue); }
.ev-project, .lay-projects { --c: var(--ev-green); }
.ev-task, .lay-tasks, .lay-tasks_other { --c: var(--ev-violet); }
.ev-pay, .lay-payments { --c: var(--ev-teal); }
.ev-abs, .lay-absences { --c: var(--ev-gray); }
.ev-orange { --c: var(--ev-orange); } .ev-blue { --c: var(--ev-blue); } .ev-green { --c: var(--ev-green); }
.ev-violet { --c: var(--ev-violet); } .ev-red { --c: var(--ev-red); } .ev-gray { --c: var(--ev-gray); }
.abs-vacation { --c: var(--ev-green); } .abs-leavesick { --c: var(--ev-red); } .abs-assignment { --c: var(--ev-blue); }
.abs-dayoff { --c: var(--ev-gold); } .abs-other { --c: var(--ev-gray); }

.cal-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px; align-items: start; }
.cal-side { position: sticky; top: 12px; font-size: 13px; }
.cal-side-k { font-size: 10.5px; letter-spacing: 1.3px; text-transform: uppercase; font-weight: 700; color: var(--dim); margin-bottom: 8px; }
.cal-layer { display: flex; align-items: center; gap: 8px; padding: 5px 0; margin: 0; cursor: pointer; color: var(--text); position: relative;
  font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.cal-layer input { position: absolute; opacity: 0; pointer-events: none; }
.cal-sw { width: 14px; height: 14px; border: 2px solid var(--c); border-radius: 3px; flex: none; }
.cal-layer input:checked + .cal-sw { background: var(--c); }
.cal-layer input:focus-visible + .cal-sw { outline: 2px solid var(--accent); outline-offset: 2px; }
.cal-project { margin-top: 16px; }
.cal-project select { width: 100%; }
.cal-side-link { display: inline-block; margin-top: 14px; font-weight: 600; }

.cal-nav { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-title { margin: 0 0 0 12px; font-size: 20px; font-weight: 700; color: var(--strong); }

.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--hair); border-left: 1px solid var(--hair); }
.cal-wd { padding: 6px 8px; font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 700; color: var(--dim);
  border-right: 1px solid var(--hair); border-bottom: 1px solid var(--hair); background: var(--surface); }
.cal-cell { min-height: 112px; padding: 4px 4px 6px; border-right: 1px solid var(--hair); border-bottom: 1px solid var(--hair); min-width: 0; }
.cal-cell.off, .tg .off, .abs-grid .off { background: var(--cal-off); }
.cal-cell.other .cal-num { color: var(--line-art); }
.cal-cell-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3px; }
.cal-num { font-size: 12.5px; font-weight: 700; color: var(--strong); border: 0; padding: 1px 6px; border-radius: 10px; }
.cal-cell.today .cal-num, .tg-dh.today b { background: var(--accent); color: var(--on-dark); }
.cal-add { opacity: 0; font-size: 16px; line-height: 1; padding: 0 6px; color: var(--muted); border: 0; }
.cal-cell:hover .cal-add, .cal-add:focus { opacity: 1; }
.cal-more { display: block; font-size: 11px; color: var(--muted); padding: 1px 6px; border: 0; }

.cal-item { display: flex; align-items: baseline; gap: 5px; min-width: 0; overflow: hidden; margin: 2px 0; padding: 2px 6px; font-size: 11.5px; line-height: 1.35;
  color: var(--text); border: 0; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); border-radius: 2px; }
.cal-item:hover { background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--strong); }
.cal-item.allday { background: color-mix(in srgb, var(--c) 30%, transparent); }
.cal-item.faded { opacity: .5; text-decoration: line-through; }
.cal-item.alert .cal-name { color: var(--bad-text); font-weight: 700; }
.cal-time { font-weight: 700; color: var(--strong); flex: none; font-variant-numeric: tabular-nums; }
.cal-kind { flex: none; font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.cal-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cal-rep { flex: none; color: var(--muted); }
.cal-note { flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--muted); margin-left: auto; }

.cal-none { color: var(--line-art); font-size: 12px; margin: 6px; }
.cal-month .cal-kind, .cal-month .cal-time-end { display: none; }      /* в ячейке месяца — только начало и название */
/* Узкая ячейка месяца: время и название переносятся, не больше 3 строк */
.cal-month .cal-item { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.cal-month .cal-time { margin-right: 4px; }
.cal-month .cal-name { white-space: normal; }
.ev-days label, .people-checks label { text-transform: none; letter-spacing: 0; }

.cal-list .cal-item { font-size: 13.5px; padding: 8px 12px; margin: 6px 0; }
.cal-list .cal-name { white-space: normal; }
.cal-list .cal-time { min-width: 92px; }
.cal-list-day { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--hair); }
.cal-list-date { border: 0; color: var(--strong); }
.cal-list-date span { display: block; color: var(--dim); font-size: 12px; }
.cal-list-day.today .cal-list-date b { color: var(--accent-text); }

/* Главная и карточка проекта: строки «сегодня в календаре» */
.cal-today { border-top: 1px solid var(--hair); }
.cal-today-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 9px 0; border: 0; border-bottom: 1px solid var(--hair); color: var(--text); }
.cal-today-row:hover b { color: var(--accent-text); }
.cal-today-row .cal-time { min-width: 92px; }
.cal-today-row .dim { font-size: 11.5px; }
.cal-today-row.faded { opacity: .5; }
.cal-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; align-self: center; }
.cal-absent { margin-top: 10px; }

/* Карточка события */
.ev-respond { align-items: center; }
.ev-people { list-style: none; padding: 0; margin: 0; }
.ev-people li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--hair); font-size: 13px; }
.ev-people .ev-who { flex: 1; }
.ev-st { font-size: 11px; font-weight: 700; letter-spacing: .4px; padding: 2px 8px; border: 1px solid var(--hair); color: var(--muted); }
.ev-st.st-Y { color: var(--ok); border-color: var(--ok-line); }
.ev-st.st-N { color: var(--bad-text); background: var(--bad-bg); border-color: transparent; }
.ev-delete { display: flex; gap: 24px; flex-wrap: wrap; }
.ev-delete form { margin: 0; }

/* Форма события */
.ev-form { max-width: 820px; }
.ev-form .inline-form { margin-bottom: 16px; }
.ev-when .field { min-width: 140px; }
.ev-people-filter { max-width: 320px; margin-bottom: 8px; }
.ev-days { display: flex; gap: 14px; flex-wrap: wrap; }
.ev-days label { display: inline-flex; align-items: center; gap: 4px; font-weight: 400; }
.ev-busy ul { margin: 6px 0 0; padding-left: 18px; }
.ev-busy-ok { color: var(--ok); }
.ev-form [hidden], .people-checks label[hidden] { display: none !important; }

/* График отсутствий */
.abs-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.abs-legend span { display: inline-flex; align-items: center; gap: 6px; }
.abs-grid { border-collapse: collapse; font-size: 12px; width: 100%; }
.abs-grid th, .abs-grid td { border: 1px solid var(--hair); padding: 0; text-align: center; height: 30px; min-width: 26px; }
.abs-grid th { font-weight: 700; color: var(--strong); background: var(--surface); }
.abs-grid th.off { background: var(--cal-off); }
.abs-grid th span { display: block; font-size: 9.5px; color: var(--dim); text-transform: uppercase; font-weight: 600; }
.abs-grid th.today { color: var(--accent-text); }
.abs-grid .abs-name { text-align: left; padding: 0 10px; white-space: nowrap; min-width: 180px; font-weight: 600; }
.abs-grid td.today { box-shadow: inset 0 0 0 2px var(--accent); }
i.abs-cell, a.abs-cell { display: inline-block; width: 14px; height: 14px; background: var(--c); border: 0; vertical-align: -2px; }
.abs-grid a.abs-cell { display: block; width: 100%; height: 30px; }
.abs-grid a.abs-free { display: block; width: 100%; height: 30px; border: 0; }
.abs-grid a.abs-free:hover { background: var(--surface2); }

@media (max-width: 940px) {
  .cal-layout { grid-template-columns: 1fr; gap: 12px; }
  .cal-side { position: static; }
  .cal-side form { display: flex; flex-wrap: wrap; gap: 0 16px; align-items: center; }
  .cal-side-k { width: 100%; margin: 0; }
  .cal-project { margin: 6px 0 0; width: 100%; }
}
@media (max-width: 720px) {
  .cal-cell { min-height: 64px; padding: 2px; }
  .cal-month .cal-item .cal-time, .cal-month .cal-kind, .cal-month .cal-rep { display: none; }
  .cal-month .cal-item { padding: 1px 3px; font-size: 10px; }
  .cal-list-day { grid-template-columns: 1fr; gap: 4px; }
  .cal-title { margin-left: 0; width: 100%; font-size: 17px; }
}

/* Э9 (замечание Александра 30.10.2026): «Неделя» и «День» — почасовая сетка, как в Б24.
   Шапка, строка «весь день» и тело — одна сетка колонок: слева часы (52 px), дальше --n дней.
   Час — --hour px (services.HOUR_PX); положение события — style из services.time_grid. */
.tg { border: 1px solid var(--hair); border-right: 0; }
.tg-row { display: grid; grid-template-columns: 52px repeat(var(--n), minmax(0, 1fr)); }
.tg-row > * { border-right: 1px solid var(--hair); min-width: 0; }
.tg-gutter { font-size: 10.5px; color: var(--dim); text-align: right; padding: 4px 6px 0 0; }
.tg-head > *, .tg-allday > * { border-bottom: 1px solid var(--hair); }
.tg-head { background: var(--surface); }
.tg-dh { padding: 6px 8px; font-size: 12.5px; }
.tg-dh a { border: 0; color: var(--strong); }
.tg-dh span { color: var(--dim); text-transform: uppercase; font-size: 10.5px; letter-spacing: 1px; }
.tg-dh b { padding: 1px 6px; border-radius: 10px; }
.tg-dh.today b { color: var(--on-dark); }
.tg-allday .tg-gutter { padding-top: 6px; line-height: 1.2; }
.tg-ad { padding: 2px 3px; min-height: 28px; }
/* Полоса прокрутки тела скрыта (крутится колёсиком и пальцем): иначе она отъедает ширину, и столбцы
   тела съезжают относительно шапки (замечание Александра 30.10.2026 «смещаются данные»). */
.tg-scroll { height: min(70vh, 640px); overflow-y: auto; scrollbar-width: none; }
.tg-scroll::-webkit-scrollbar { display: none; }
.tg-hours { padding: 0; }
.tg-h { height: var(--hour); position: relative; }
.tg-h span { position: relative; top: 1px; }     /* подпись — сразу под линией своего часа */
/* Линии часов — фон столбца; щелчок по пустому месту — новое событие (курсор подсказывает) */
.tg-col { position: relative; height: calc(var(--hour) * 24);
  background-image: repeating-linear-gradient(to bottom, var(--hair) 0 1px, transparent 1px var(--hour)); }
.tg-col[data-new] { cursor: copy; }
.tg-col.today { background-color: color-mix(in srgb, var(--accent) 4%, transparent); }
.tg-ev { position: absolute; margin: 1px 0 0 0; display: block; overflow: hidden; padding: 2px 5px; cursor: pointer;
  border-right: 2px solid var(--ground); box-sizing: border-box; }
/* Время и название — подряд в строку: у короткой встречи (30 мин) название тоже видно */
.tg-ev .cal-time { font-size: 10.5px; margin-right: 4px; }
.tg-ev .cal-kind { margin-right: 3px; }
.tg-ev .cal-time-end { display: none; }     /* длительность видна по высоте, конец — во всплывающей подсказке */
.tg-ev .cal-name { white-space: normal; display: inline; }
.tg-ev .cal-note { display: block; max-width: 100%; margin: 0; }
.tg-ev .badge { display: none; }
.tg-now { position: absolute; left: 0; right: 0; border-top: 2px solid var(--bad); z-index: 2; pointer-events: none; }
.tg-now::before { content: ""; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.tg-one .tg-dh, .tg-one .tg-ad { text-align: left; }
.ev-menu { position: relative; }
.ev-menu .menu { right: 0; left: auto; text-align: left; white-space: nowrap; }
.ev-menu .menu a { text-align: left; }
@media (max-width: 720px) {
  .tg:not(.tg-one) { overflow-x: auto; }
  .tg:not(.tg-one) .tg-row { min-width: 720px; }
  .tg:not(.tg-one) .tg-scroll { min-width: 720px; overflow-x: hidden; }
}
/* Сегодняшний день — тонкая оранжевая рамка (замечание Александра 30.10.2026): в «Месяце» — вокруг ячейки,
   в «Неделе» и «Дне» — вокруг всего столбца (шапка, «весь день», часы). Рамка рисуется наложением ::after
   поверх содержимого и серых линий сетки, поэтому везде одного цвета и события её не закрывают. */
.cal-cell.today, .tg .tg-dh.today, .tg .tg-ad.today { position: relative; }
.cal-cell.today::after, .tg .today::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  border: 1px solid var(--accent); }
.tg .tg-dh.today::after { border-bottom: 0; }
.tg .tg-ad.today::after { border-top: 0; border-bottom: 0; }
.tg .tg-col.today::after { border-top: 0; }
.tg-one .today::after { display: none; }   /* «День» — один столбец, рамка не нужна (замечание Александра 30.10.2026) */
/* --- Э10. Claude Code: ключи и база знаний ------------------------------------------------------------- */
.key-new { margin-bottom: 8px; }
.key-box { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--accent);
  background: var(--surface); margin: 10px 0; }
.key-box code { font-size: 13px; color: var(--strong); word-break: break-all; flex: 1; min-width: 0; }
.kb-filter { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 6px; font-size: 12.5px; }
.kb-filter a { border-bottom: 1px solid transparent; color: var(--muted); }
.kb-filter a.on { color: var(--strong); border-bottom-color: var(--accent); font-weight: 600; }
.kb-text { white-space: pre-wrap; word-wrap: break-word; font: 12.5px/1.65 var(--font, inherit); color: var(--text);
  border: 1px solid var(--hair); padding: 14px 16px; max-height: 70vh; overflow-y: auto; background: var(--surface); }
.kb-hist { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.8; }
.kb-help { margin: 18px 0; max-width: 640px; font-size: 12.5px; color: var(--muted); }
.kb-help summary { cursor: pointer; color: var(--text); }
.kb-help pre { white-space: pre-wrap; border: 1px solid var(--hair); padding: 10px 12px; background: var(--surface); font-size: 12px; }
