/* СУПРО 5.0 — основные стили. Без сборки и без внешних шрифтов. */

:root {
    /* Палитра от логотипа: графит + один сигнальный цвет для уведомлений и акцентов */
    --bg: #f4f4f3;
    --surface: #ffffff;
    --surface-2: #f7f7f6;
    --text: #1f1f1f;
    --muted: #6b6b6b;
    --border: #e3e3e1;
    --brand: #262626;          /* цвет логотипа, основные кнопки */
    --brand-hover: #000000;
    --brand-text: #ffffff;
    --brand-soft: #ececea;     /* выбранный пункт меню */
    --accent: #d9480f;         /* сигнальный: счётчики, отметки, «0 ₽» */
    --accent-soft: #fff0e6;
    --link: #1f5fbf;
    --ok: #2b7a3d;
    --ok-soft: #e8f4ea;
    --warn: #a35a00;
    --warn-soft: #fff5e0;
    --danger: #b42318;
    --danger-soft: #fdecea;
    --info-soft: #e9eff9;
    --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 1px 3px rgba(0, 0, 0, .06);
    --radius: 8px;
    --radius-sm: 6px;
    --topbar-h: 56px;
    --sidebar-w: 264px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg: #121212; --surface: #1b1b1b; --surface-2: #232323; --text: #ececec; --muted: #9e9e9e;
        --border: #2f2f2f; --brand: #ececec; --brand-hover: #ffffff; --brand-text: #141414; --brand-soft: #2c2c2c;
        --accent: #ff8a3d; --accent-soft: #3a2416;
        --link: #8fb3ff; --ok: #5fd07a; --ok-soft: #15301d; --warn: #f2b84b; --warn-soft: #33290f;
        --danger: #f87171; --danger-soft: #3a1717; --info-soft: #1b2438;
        --shadow: 0 1px 2px rgba(0, 0, 0, .5); color-scheme: dark;
    }
}
:root[data-theme="standard"] {
    /* «Стандартная» — цвета СУПРО 4 (модификация 3): белый, сине-фиолетовый #5D5FEF, графитовый логотип (с. 48) */
    --bg: #f4f4fb; --surface: #ffffff; --surface-2: #f6f6fe; --text: #262626; --muted: #6b6b7b;
    --border: #dfdff3; --brand: #5d5fef; --brand-hover: #4547d9; --brand-text: #ffffff; --brand-soft: #ebebfd;
    --link: #4b4de0; --info-soft: #ececfd; --logo: #262626;
}
:root[data-theme="dark"] {
    --bg: #121212; --surface: #1b1b1b; --surface-2: #232323; --text: #ececec; --muted: #9e9e9e;
    --border: #2f2f2f; --brand: #ececec; --brand-hover: #ffffff; --brand-text: #141414; --brand-soft: #2c2c2c;
    --accent: #ff8a3d; --accent-soft: #3a2416;
    --link: #8fb3ff; --ok: #5fd07a; --ok-soft: #15301d; --warn: #f2b84b; --warn-soft: #33290f;
    --danger: #f87171; --danger-soft: #3a1717; --info-soft: #1b2438;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; background: var(--bg); color: var(--text);
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; font-weight: 750; letter-spacing: -.01em; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 .75em; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Кнопки */
.btn {
    display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
    border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text);
    font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-text); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-icon { width: 40px; padding: 0; justify-content: center; }

/* Плашка тестовой площадки */
.test-banner { background: var(--warn-soft); color: var(--warn); text-align: center; font-size: 13px; padding: 6px 16px; }

/* Шапка */
.topbar {
    position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
    display: flex; align-items: center; gap: 8px; padding: 0 12px;
    background: var(--surface); border-bottom: 1px solid var(--border);
}
.logo { display: inline-flex; align-items: center; color: var(--logo, var(--brand)); padding: 4px 2px; }
.logo:hover { color: var(--logo, var(--brand-hover)); }
.logo-svg { display: block; height: 22px; width: auto; }
.guest-top .logo-svg { height: 28px; }
.topbar-spacer { flex: 1; }
.badge {
    display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
}
.bell { position: relative; }
.bell .badge { position: absolute; top: 4px; right: 2px; }
.user-menu { position: relative; }
.avatar {
    display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%;
    background: var(--brand-soft); color: var(--text); font-weight: 700; font-size: 13px; flex: none;
}
.dropdown {
    position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; padding: 6px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.dropdown[hidden] { display: none; }
.dropdown a, .dropdown button {
    display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
    color: var(--text); background: none; border: 0; font: inherit; text-align: left; cursor: pointer;
}
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); text-decoration: none; }
.dropdown hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }

/* Каркас: меню слева + содержимое */
.shell {
    display: flex; min-height: calc(100vh - var(--topbar-h));
    /* фон меню тянется до низа длинной страницы */
    background: linear-gradient(to right, var(--surface) calc(var(--sidebar-w) - 1px), var(--border) calc(var(--sidebar-w) - 1px), var(--border) var(--sidebar-w), transparent var(--sidebar-w));
}
.sidebar {
    width: var(--sidebar-w); flex: none; padding: 12px; background: var(--surface);
    border-right: 1px solid var(--border); overflow-y: auto;
    position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h));
}
.nav-section { margin-bottom: 14px; }
.nav-title { padding: 6px 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.nav-link {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text);
}
.nav-link:hover { background: var(--surface-2); text-decoration: none; }
.nav-link.is-active { background: var(--brand-soft); color: var(--text); font-weight: 650; box-shadow: inset 3px 0 0 var(--brand); }
.nav-link .badge { margin-left: auto; }
.nav-team > summary { list-style: none; cursor: pointer; }
.nav-team > summary::-webkit-details-marker { display: none; }
.nav-team > summary .chev { margin-left: auto; transition: transform .15s; }
.nav-team[open] > summary .chev { transform: rotate(90deg); }
.nav-team .nav-link.sub { padding-left: 40px; font-size: 14px; }
.content { flex: 1; min-width: 0; padding: 24px; }

/* С. 49: каркас рабочих страниц — в конце файла (раздел «Каркас как в СУПРО 4») */
.content-inner { max-width: 1200px; margin: 0 auto; }
.overlay { display: none; }

/* Карточки и сетки */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.stack > .card + .card { margin-top: 12px; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-danger { background: var(--danger-soft); color: var(--danger); }
.chip-info { background: var(--info-soft); color: var(--link); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--border); }
.list li:first-child { border-top: 0; padding-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.tabs { display: flex; gap: 4px; padding: 3px; background: var(--surface-2); border-radius: var(--radius); margin-bottom: 12px; }
.tabs button { flex: 1; height: 32px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.post-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }

/* Подвал */
.footer { padding: 16px 24px; color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px 20px; border-top: 1px solid var(--border); background: var(--surface); }
.footer a { color: var(--muted); }

/* Гостевые страницы */
.guest-top { display: flex; align-items: center; gap: 12px; max-width: 1120px; margin: 0 auto; padding: 16px; }
.guest-top .actions { margin-left: auto; display: flex; gap: 8px; }
.hero { max-width: 1120px; margin: 0 auto; padding: 48px 16px 32px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 42px; margin-bottom: 16px; letter-spacing: -.02em; }
.hero .lead { font-size: 18px; color: var(--muted); margin-bottom: 24px; }
.hero .btn + .btn { margin-left: 8px; }
.hero .stamp { display: inline-block; padding: 6px 12px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); font-weight: 700; margin-bottom: 16px; }
.features { max-width: 1120px; margin: 0 auto; padding: 16px 16px 48px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature .icon { width: 28px; height: 28px; color: var(--brand); margin-bottom: 8px; }
.board-demo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.board-demo .col { background: var(--surface-2); border-radius: var(--radius); padding: 8px; }
.board-demo .col h3 { font-size: 12px; color: var(--muted); margin: 2px 4px 8px; }
.board-demo .task { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px; font-size: 13px; margin-bottom: 6px; }

/* Формы */
.form { display: grid; gap: 14px; margin-top: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.field input, .field select, .field textarea, .doc-party input {
    width: 100%; height: 42px; padding: 0 12px; font: inherit; color: var(--text);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.field textarea { height: auto; min-height: 96px; padding: 10px 12px; }
.field input:focus, .doc-party input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.hint { color: var(--muted); font-size: 13px; margin-top: 4px; }
.error { color: var(--danger); font-size: 13px; margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.form-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.btn-block { width: 100%; justify-content: center; height: 44px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--link); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.notice { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; }
.notice-ok { background: var(--ok-soft); color: var(--ok); }
.notice-test { background: var(--warn-soft); color: var(--warn); }
.notice-test a { font-weight: 700; }

/* Страницы входа и регистрации */
.auth-wrap { max-width: 440px; margin: 0 auto; padding: 40px 16px 24px; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 24px; }
.auth-logo .logo-svg { height: 30px; }
.auth-card { padding: 28px; }
.auth-card h1 { font-size: 22px; }
.auth-switch { margin: 16px 0 0; font-size: 14px; color: var(--muted); }
.auth-foot { text-align: center; margin-top: 20px; }
.auth-foot a { color: var(--muted); white-space: nowrap; }

/* Пустые состояния */
.empty { text-align: center; padding: 40px 16px; }
.empty .icon { width: 36px; height: 36px; color: var(--muted); margin-bottom: 8px; }
.nav-empty { padding: 4px 10px 8px; margin: 0; }
.dropdown form { margin: 0; }

/* VK ID, разделитель, таблицы, раздел настроек */
.btn-vk { background: #0077ff; border-color: #0077ff; color: #fff; }
.btn-vk:hover { background: #0066dd; border-color: #0066dd; }
.btn-ya { background: #000; border-color: #000; color: #fff; }
.btn-ya:hover { background: #262626; border-color: #262626; }
.btn-vk + .btn-ya { margin-top: 8px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 16px 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.notice-danger { background: var(--danger-soft); color: var(--danger); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.section { margin-top: 16px; }
.card-head .muted { margin-left: auto; }
.card-head-action { margin-left: auto; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }

/* Настройки и профиль */
.subnav { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 4px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.subnav a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.subnav a:hover { color: var(--text); text-decoration: none; }
.subnav a.is-active { color: var(--text); border-bottom-color: var(--brand); }
img.avatar { object-fit: cover; display: inline-block; }
.avatar-edit { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.inline-form input[type=file] { font: inherit; font-size: 14px; max-width: 100%; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.field select { width: 100%; height: 42px; padding: 0 10px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.field input:disabled { background: var(--surface-2); color: var(--muted); }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; margin-top: 12px; }
.form-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.form-actions form { margin: 0; }
.channels { display: grid; gap: 8px; margin-top: 12px; }
.channel { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.channel.is-current { border-color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.channel-pick { display: flex; align-items: center; gap: 12px; flex: 1; cursor: pointer; }
.channel-pick input { width: 18px; height: 18px; accent-color: var(--brand); }
.channel-pick input:disabled + .icon { opacity: .4; }
.channel-pick > span { display: flex; flex-direction: column; }
.channel form { margin: 0; }
.profile-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.profile-head h1 { margin: 0 0 4px; }
.profile-head .grow { flex: 1; min-width: 220px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.facts { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; margin: 0; }
.facts dt { color: var(--muted); font-size: 14px; }
.facts dd { margin: 0; }
.pre { white-space: pre-line; }

/* Резюме, опасные действия */
.resume-list details > summary { list-style: none; display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.resume-list details > summary::-webkit-details-marker { display: none; }
.resume-list details > summary .link-btn { margin-left: auto; white-space: nowrap; }
.resume-list details[open] > summary .link-btn { visibility: hidden; }
.resume-list details[open] { background: var(--surface-2); border-radius: var(--radius); padding: 12px; }
.resume-item p { margin: 6px 0 0; }
.add-block { margin-top: 12px; }
.add-block > summary { list-style: none; display: inline-flex; }
.add-block > summary::-webkit-details-marker, .danger-card details > summary::-webkit-details-marker { display: none; }
.add-block[open] > summary { display: none; }
.period { display: grid; grid-template-columns: 1.4fr 1fr 1.4fr 1fr; gap: 12px; }
.danger-zone { margin-top: 8px; }
.link-btn.danger { color: var(--danger); }
.danger-card { border-color: var(--danger-soft); }
.danger-card details > summary { list-style: none; display: inline-flex; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-outline { color: var(--danger); border-color: var(--danger); }
.guest-notice { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* Команды */
.kind-switch { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kind-switch legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }
.kind-option { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.kind-option:has(input:checked) { border-color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.kind-option input { margin-top: 3px; accent-color: var(--brand); }
.kind-option > span { display: flex; flex-direction: column; }
.inn-row { display: flex; gap: 8px; align-items: flex-end; }
.inn-row .field { flex: 1; max-width: 320px; }
.inn-row .btn { height: 42px; }
.lookup-msg { margin: 0; }
.field textarea[rows="2"] { min-height: 64px; }
.more-fields > summary { list-style: none; cursor: pointer; font-weight: 600; }
.more-fields > summary::-webkit-details-marker { display: none; }
.more-fields[open] > summary { margin-bottom: 12px; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.team-card { display: flex; gap: 12px; align-items: center; color: var(--text); }
.team-card:hover { text-decoration: none; border-color: var(--brand); }
.team-logo { display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius); background: var(--brand); color: var(--brand-text); font-weight: 800; flex: none; object-fit: cover; }

/* Планшет */
@media (max-width: 1100px) {
    .grid-main { grid-template-columns: 1fr; }
    .grid-main > aside { order: -1; } /* на узком экране задачи — первыми */
    .grid-2 { grid-template-columns: 1fr; }
    .form-grid-3 { grid-template-columns: 1fr 1fr; }
}

/* Телефон: меню выезжает слева */
@media (max-width: 860px) {
    .sidebar {
        position: fixed; z-index: 40; left: 0; top: 0; height: 100vh; width: min(86vw, 300px);
        transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow);
    }
    body.menu-open .sidebar { transform: none; }
    .shell { background: none; }
    body.menu-open .overlay { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, .35); }
    .content { padding: 16px; }
    .hero { grid-template-columns: 1fr; padding-top: 24px; }
    .hero h1 { font-size: 30px; }
    .features { grid-template-columns: 1fr; }
    .page-head .actions { margin-left: 0; width: 100%; }
    .page-head .actions .btn { flex: 1; justify-content: center; }
    .form-grid, .form-grid-3, .checks { grid-template-columns: 1fr; }
    .period { grid-template-columns: 1.4fr 1fr; }
    .kind-switch { grid-template-columns: 1fr; }
    .facts { grid-template-columns: 1fr; gap: 2px; }
    .facts dd { margin-bottom: 8px; }
    .auth-wrap { padding-top: 24px; }
    .auth-card { padding: 20px; }
    .hide-mobile { display: none !important; }
}
@media (min-width: 861px) {
    .show-mobile { display: none !important; }
}

/* Приглашения в команду (сессия 10) */
.copy-row { display: flex; gap: 8px; margin-bottom: 10px; }
.copy-row input { flex: 1; min-width: 0; height: 40px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; }
.copy-row .btn.is-done { background: var(--ok); border-color: var(--ok); }
.card .chips + form, .card .chips + .inline-form { margin-top: 8px; }
.list li > form { align-self: center; }
.list li > .icon, .list li > .team-logo { flex: none; }
.row-menu { align-self: center; }
.row-menu summary { list-style: none; cursor: pointer; }
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu[open] .inline-form, .danger-zone details[open] .inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.danger-zone summary { list-style: none; cursor: pointer; display: inline-block; }
.danger-zone summary::-webkit-details-marker { display: none; }
.invite-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.invite-head h1 { margin: 2px 0; }
.invite-note { margin: 0 0 16px; padding: 8px 12px; border-left: 3px solid var(--border); color: var(--muted); white-space: pre-line; }
.invite-banner { display: flex; align-items: center; gap: 10px; }
.auth-card .btn-block + .btn-block { margin-top: 8px; }
.auth-card form + .center { margin-top: 12px; }
.center { text-align: center; }
@media (max-width: 640px) {
    .list li { flex-wrap: wrap; }
    .list li > .grow { flex: 1 1 calc(100% - 60px); }
    .list li > form, .list li > .row-menu { margin-left: 50px; }
    .copy-row { flex-direction: column; }
}

/* Оргструктура (сессия 11) */
.view-switch { display: inline-flex; gap: 4px; padding: 3px; background: var(--surface-2); border-radius: var(--radius); }
.view-switch a { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 600; font-size: 14px; }
.view-switch a:hover { text-decoration: none; color: var(--text); }
.view-switch a.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.btn-sm { height: 28px; width: 28px; }

.org-chart-wrap { overflow-x: auto; margin-top: 12px; padding: 24px 16px; }
.org-chart, .org-chart ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; }
.org-chart { min-width: max-content; }
.org-chart ul { padding-top: 20px; position: relative; }
.org-chart li { position: relative; padding: 20px 6px 0; display: flex; flex-direction: column; align-items: center; }
.org-chart > li { padding-top: 0; }
/* соединительные линии */
.org-chart ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 20px; border-left: 1px solid var(--border); }
.org-chart ul > li::before, .org-chart ul > li::after { content: ""; position: absolute; top: 0; width: 50%; height: 20px; border-top: 1px solid var(--border); }
.org-chart ul > li::before { right: 50%; }
.org-chart ul > li::after { left: 50%; border-left: 1px solid var(--border); }
.org-chart ul > li:first-child::before, .org-chart ul > li:last-child::after { border-top: 0; }
.org-chart ul > li:only-child::before { display: none; }
.org-chart ul > li:only-child::after { border-top: 0; }
.org-chart ul > li:first-child::after { border-radius: 6px 0 0 0; }
.org-chart ul > li:last-child::before { border-right: 1px solid var(--border); border-radius: 0 6px 0 0; }
.org-box { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 150px; max-width: 220px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-align: center; font: inherit; font-size: 13px; box-shadow: var(--shadow); cursor: pointer; }
.org-box:hover, .org-box:focus-visible { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.org-box strong { font-size: 14px; }
.org-chart > li > .org-box { border-width: 2px; border-color: var(--brand); }
.org-person { display: flex; align-items: center; gap: 8px; text-align: left; }
.org-person .avatar { flex: none; }
.org-person-text { display: flex; flex-direction: column; line-height: 1.25; }
.org-head { font-weight: 600; }

.modal { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 64px); padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
.modal::backdrop { background: rgba(0, 0, 0, .45); }
.modal-close { position: absolute; top: 8px; right: 8px; }
.unit-info h2 { margin: 2px 40px 8px 0; }
.unit-info .list { margin-top: 12px; }

.org-list { list-style: none; margin: 0; padding: 0; }
.org-list .org-list { margin-left: 22px; padding-left: 14px; border-left: 1px dashed var(--border); }
.org-node { margin-top: 12px; }
.org-card { padding: 14px 16px; }
.org-card-head { display: flex; align-items: center; gap: 10px; }
.org-card-head h2 { margin: 0; font-size: 16px; }
.org-tools { display: inline-flex; gap: 2px; }
.org-tools form { display: inline; }
.org-members { margin-top: 10px; }
.org-actions { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: flex-start; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 14px; }
.org-actions details { max-width: 100%; }
.org-actions summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.org-actions summary::-webkit-details-marker { display: none; }
.org-actions details[open] { flex-basis: 100%; }
.org-form { margin-top: 10px; }
.org-form input:not([type]), .org-form input[type=text], .assign-inline input, .assign-inline select { height: 36px; }
.assign-inline { display: flex; flex-wrap: wrap; gap: 6px; }
.row-menu[open] { flex-basis: 100%; }
@media (max-width: 640px) {
    .org-list .org-list { margin-left: 8px; padding-left: 8px; }
}
.inline-form input:not([type=file]):not([type=hidden]):not([type=checkbox]), .inline-form select { height: 36px; padding: 0 10px; font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); min-width: 0; }
.inline-form input[name=title] { flex: 1 1 220px; }
.org-faces { display: flex; }
.org-faces .avatar { border: 2px solid var(--surface); margin-left: -6px; }
.org-faces .avatar:first-child { margin-left: 0; }

/* Роли (сессия 12) */
.role-select { height: 32px; padding: 0 6px; font: inherit; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.role-badge { display: inline-block; font-size: 13px; }
.role-head { font-weight: 700; }
.role-admin { color: var(--link); }
.role-observer { color: var(--warn); }
.role-none { color: var(--muted); }
select.role-none { color: var(--muted); }

/* Коллеги — звезда «Мои коллеги» (и в профиле) */
.fav .icon { fill: none; }
.fav.is-on { color: var(--accent); }
.fav.is-on .icon { fill: currentColor; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pager [aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* Администрирование и поддержка (сессия 14) */
.impersonation-bar { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 8px 16px; background: var(--accent); color: #fff; font-size: 14px; }
.impersonation-bar form { margin: 0; }
.impersonation-bar .btn-sm-text { height: 30px; padding: 0 12px; border: 1px solid #fff; border-radius: var(--radius-sm); background: transparent; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat { padding: 16px; }
.stat-n { font-size: 28px; font-weight: 700; }
.admin-filter { display: grid; grid-template-columns: 2fr 1fr auto; gap: 12px; align-items: end; }
.admin-filter .form-actions { margin: 0; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.admin-actions + .admin-actions { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.admin-actions details[open] { flex-basis: 100%; }
.admin-actions summary { list-style: none; cursor: pointer; }
.admin-actions summary::-webkit-details-marker { display: none; }
.thread { display: flex; flex-direction: column; gap: 10px; }
.msg { padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); max-width: 85%; }
.msg-support { align-self: flex-end; background: var(--info-soft); }
.msg .pre { margin-top: 4px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 640px) { .admin-filter { grid-template-columns: 1fr; } .msg { max-width: 100%; } }

/* Проекты (сессия 15) */
.projects-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.projects-search { flex: 1 1 200px; margin: 0; }
.projects-search input[name=q] { width: 100%; }
.project-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; flex: none; }
.projects-table tr.is-dim td { opacity: .55; }
.text-danger { color: var(--danger); font-weight: 600; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.project-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-top: 4px solid var(--pc); color: var(--text); }
.project-card:hover { text-decoration: none; border-color: var(--pc); box-shadow: 0 0 0 3px var(--brand-soft); }
.project-head { display: flex; gap: 16px; align-items: flex-start; border-left: 6px solid var(--pc); }
.project-head h1 { margin: 0 0 4px; }
.crumbs { margin-bottom: 10px; color: var(--muted); }
.passport dt { font-weight: 600; }
.stack-actions { display: flex; flex-direction: column; gap: 8px; }
.stack-actions details summary { list-style: none; cursor: pointer; }
.stack-actions details summary::-webkit-details-marker { display: none; }
.color-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.color-pick input { position: absolute; opacity: 0; }
.color-pick span { display: block; width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border); cursor: pointer; }
.color-pick input:checked + span { box-shadow: 0 0 0 2px var(--brand); }
.color-pick input:focus-visible + span { outline: 2px solid var(--link); }
.field .label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.project-head .grow { flex: 1; min-width: 0; }

/* Доски (сессия 16) */
.board-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.board-title { margin: 2px 0 0; }
.board-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.board-tabs > a { padding: 8px 14px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 600; }
.board-tabs > a:hover { text-decoration: none; color: var(--text); background: var(--surface-2); }
.board-tabs > a.is-active { color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.board-add summary { list-style: none; cursor: pointer; width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--radius-sm); color: var(--muted); font-size: 20px; }
.board-add summary::-webkit-details-marker { display: none; }
.board-add[open] { display: flex; align-items: center; gap: 6px; }
.board-add form { margin: 0; }
.board-menu { right: 0; left: auto; min-width: 260px; padding: 10px; }
.board-menu form { margin: 0 0 8px; }
.dd-form { display: flex; flex-direction: column; gap: 4px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.dd-form input, .dd-form select { height: 34px; padding: 0 8px; font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.board-lines { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.board-line { flex: 0 0 272px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 120px; }
.board-line h2 { font-size: 14px; margin: 2px 4px 10px; }
.line-empty { padding: 18px 4px; text-align: center; }
.board-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.board-chip { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1px solid var(--border); border-left: 4px solid var(--pc); border-radius: var(--radius-sm); color: var(--text); background: var(--surface); }
.board-chip:hover { text-decoration: none; border-color: var(--brand); }
.board-chip.is-archived { opacity: .6; }
.recent-boards { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.recent-boards .chip:hover { text-decoration: none; color: var(--text); }
.board-top > .grow { flex: 1; min-width: 0; }

/* Линии и карточки (сессия 17) */
.board-lines { min-height: 60vh; }
.board-line { display: flex; flex-direction: column; max-height: calc(100vh - 230px); }
.line-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.line-head h2 { margin: 0; font-size: 14px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.drag-handle { cursor: grab; color: var(--muted); font-size: 12px; letter-spacing: -2px; padding: 2px 4px; user-select: none; touch-action: none; }
.line-menu { position: relative; }
.line-menu summary { list-style: none; cursor: pointer; padding: 0 6px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 700; }
.line-menu summary::-webkit-details-marker { display: none; }
.line-menu-body { position: absolute; right: 0; top: 24px; z-index: 20; width: 240px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.15); display: flex; flex-direction: column; gap: 8px; }
.line-shift { display: flex; gap: 6px; }
.line-shift form { flex: 1; } .line-shift .btn { width: 100%; justify-content: center; height: 32px; padding: 0 8px; font-size: 13px; }
.line-cards { display: flex; flex-direction: column; gap: 8px; min-height: 36px; overflow-y: auto; padding: 2px; }
.task-card { position: relative; display: flex; align-items: flex-start; gap: 6px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); font-size: 14px; }
.task-card[data-draggable] { cursor: grab; }
.task-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.task-title { min-width: 0; overflow-wrap: anywhere; color: var(--text); text-decoration: none; }
.task-link::after { content: ''; position: absolute; inset: 0; }
.task-card .drag-handle, .task-card .task-avatar { position: relative; z-index: 1; }
.task-card:hover { border-color: var(--brand); }
.task-card.is-priority { border-left: 3px solid var(--danger, #d33); }
.task-due { align-self: flex-start; font-size: 12px; color: var(--muted); }
.task-due.is-overdue, .task-facts .is-overdue { color: var(--danger, #d33); font-weight: 600; }
.quick-row { display: flex; gap: 6px; }
.quick-row input { flex: 1; min-width: 0; padding: 6px 8px; font: inherit; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.quick-add [data-carry-title] { align-self: flex-start; color: var(--muted); }
/* карточка задачи: окно и страница */
.task-sheet { max-width: 820px; }
.modal-task { width: min(760px, calc(100vw - 24px)); padding: 22px 24px; overflow-y: auto; }
.modal-task .modal-close { top: 10px; right: 10px; }
.task-panel-path { margin: 0 40px 6px 0; }
.task-title-input { width: 100%; margin: 0 0 10px; padding: 4px 6px; margin-left: -6px; font: inherit; font-size: 21px; font-weight: 700; line-height: 1.3; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm); resize: none; overflow: hidden; }
.task-title-input:hover { border-color: var(--border); }
.task-title-input:focus { border-color: var(--brand); background: var(--surface); outline: none; }
.task-title-view, .task-create-title { margin: 0 40px 10px 0; font-size: 21px; overflow-wrap: anywhere; }
.task-props { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; margin-bottom: 14px; }
.task-props .prop { display: flex; flex-direction: column; gap: 4px; min-width: 200px; }
.task-props .prop > label { font-size: 12px; color: var(--muted); }
.task-props input, .task-props select { height: 36px; padding: 0 8px; font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.prop-check { align-self: flex-end; height: 36px; align-items: center; }
.task-panel .field > label, .task-create .field > label { font-size: 12px; color: var(--muted); font-weight: 400; }
.overdue-flag { font-size: 12px; color: var(--danger); font-weight: 600; }
.task-panel textarea[name=description], .task-create textarea { width: 100%; resize: vertical; }
.task-more { margin: 4px 0 8px; }
.task-more summary { cursor: pointer; color: var(--muted); font-size: 14px; padding: 4px 0; }
.task-more[open] summary { margin-bottom: 10px; }
.task-panel-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--border); }
.save-state.is-error { color: var(--danger); font-weight: 600; }
.prio-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--danger, #d33); color: #fff; font-size: 14px; vertical-align: 3px; }
.task-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 16px 0; }
.task-facts dt { font-size: 12px; color: var(--muted); }
.task-facts dd { margin: 2px 0 0; display: flex; align-items: center; gap: 6px; }
.task-desc { white-space: normal; line-height: 1.5; padding-top: 12px; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.task-form { max-width: 820px; }
.inline-fields { display: flex; gap: 8px; }
.inline-fields input[type=date] { flex: 1; } .inline-fields input[type=time] { width: 120px; }
.finance-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 12px; margin-top: 10px; }
.finance-table { max-width: 480px; }
.card-handle { display: none; }
@media (pointer: coarse) { .card-handle { display: inline; } .task-card[data-draggable] { cursor: default; } }
.task-avatar { flex: none; }
.quick-add { margin-top: 8px; }
.quick-add summary { list-style: none; cursor: pointer; color: var(--muted); font-size: 14px; padding: 6px 4px; border-radius: var(--radius-sm); }
.quick-add summary:hover { background: var(--surface); color: var(--text); }
.quick-add summary::-webkit-details-marker { display: none; }
.quick-add form { display: flex; flex-direction: column; gap: 6px; }
.quick-add textarea, .board-line-new input { width: 100%; padding: 8px; font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); resize: vertical; }
.board-line-new { background: transparent; border-style: dashed; min-height: 0; }
.board-line-new form { display: flex; flex-direction: column; gap: 6px; }
/* перетаскивание */
.dragging { position: fixed !important; z-index: 1000; pointer-events: none; opacity: .9; box-shadow: 0 12px 30px rgba(0,0,0,.25); transform: rotate(1deg); }
.drop-placeholder { border: 2px dashed var(--border); border-radius: var(--radius-sm); background: transparent; flex: none; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; }
.task-card[data-draggable] { user-select: none; }
.finance-grid[hidden] { display: none; }
/* статусы задач и участники (сессия 19) */
.status-pill, .status-select { display: inline-flex; align-items: center; border-radius: 999px; font-size: 13px; font-weight: 600; padding: 2px 10px; border: 1px solid transparent; }
.status-pill.small { font-size: 11px; padding: 0 7px; font-weight: 600; }
.status-select { height: 30px; padding: 0 28px 0 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.st-new { background: var(--surface-2, #f1f1ef); color: var(--muted); border-color: var(--border); }
.st-work { background: #e8f0fe; color: #1a56c4; }
.st-done { background: #e6f4ea; color: #1e7b34; }
.st-checked { background: #1e7b34; color: #fff; }
.st-cancel { background: #f3f3f3; color: #8a8a8a; text-decoration: line-through; }
.task-card.st-new, .task-card.st-work, .task-card.st-done, .task-card.st-checked, .task-card.st-cancel { background: var(--surface); color: var(--text); text-decoration: none; }
.task-card.st-done .task-title, .task-card.st-checked .task-title { color: var(--muted); }
.task-card.st-cancel .task-title { color: var(--muted); text-decoration: line-through; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.task-avatar { display: inline-flex; align-items: center; gap: 2px; }
.co-count { font-size: 11px; color: var(--muted); }
.task-status-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.task-people { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 14px; }
.people-prop { display: flex; flex-direction: column; gap: 4px; }
.prop-label { font-size: 12px; color: var(--muted); }
.people-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 30px; }
.person-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 4px 2px 3px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; background: var(--surface); }
.chip-x { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; }
.chip-x:hover { color: var(--danger); }
.person-add, .task-people select[name=author_id] { height: 30px; padding: 0 8px; font: inherit; font-size: 13px; color: var(--text); background: var(--surface); border: 1px dashed var(--border); border-radius: 999px; }
.task-people select[name=author_id] { border-style: solid; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .st-work { background: #1d2b45; color: #8ab4ff; }
    :root:not([data-theme]) .st-done { background: #1b3323; color: #7fd18f; }
    :root:not([data-theme]) .st-cancel { background: #2a2a2a; }
}
:root[data-theme="dark"] .st-work { background: #1d2b45; color: #8ab4ff; }
:root[data-theme="dark"] .st-done { background: #1b3323; color: #7fd18f; }
:root[data-theme="dark"] .st-cancel { background: #2a2a2a; }
/* информационные задачи и лист ознакомления (сессия 20) */
.grow { flex: 1; }
.type-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; font-size: 13px; }
.type-switch label { display: inline-flex; align-items: center; padding: 4px 12px; cursor: pointer; color: var(--muted); }
.type-switch input { position: absolute; opacity: 0; pointer-events: none; }
.type-switch label:has(input:checked) { background: var(--text); color: var(--surface); }
.type-switch label:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: -2px; }
.task-create-head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-right: 40px; }
.task-create-head .task-create-title { margin: 0 0 10px; }
.info-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 600; background: #fff4d6; color: #8a5a00; }
.info-pill.small { font-size: 11px; padding: 0 7px; }
.info-pill.is-pending { background: #8a5a00; color: #fff; }
.acq { margin: 4px 0 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.acq-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; }
.acq-head h3 { margin: 0; font-size: 15px; }
.acq-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.acq-list li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.acq-done { color: #1e7b34; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .info-pill { background: #3a2f12; color: #f0c766; } :root:not([data-theme]) .acq-done { color: #7fd18f; } }
:root[data-theme="dark"] .info-pill { background: #3a2f12; color: #f0c766; }
:root[data-theme="dark"] .acq-done { color: #7fd18f; }
[hidden] { display: none !important; }
/* подзадачи и действия с задачей (сессия 21) */
.task-panel-top { display: flex; align-items: flex-start; gap: 8px; margin-right: 36px; }
.task-panel-top .task-panel-path { flex: 1; }
.task-sheet .task-panel-top { margin-right: 0; }
.task-actions { position: relative; }
.task-actions > summary { list-style: none; cursor: pointer; font-weight: 700; color: var(--muted); padding: 0 8px; border-radius: var(--radius-sm); line-height: 26px; }
.task-actions > summary::-webkit-details-marker { display: none; }
.task-actions > summary:hover { background: var(--surface-2); color: var(--text); }
.task-actions-body { position: absolute; right: 0; top: 30px; z-index: 30; width: 320px; max-height: 70vh; overflow-y: auto; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.18); display: flex; flex-direction: column; gap: 8px; }
.task-actions-body > button, .act-sub > summary { text-align: left; background: none; border: 0; padding: 6px 8px; border-radius: var(--radius-sm); font: inherit; font-size: 14px; color: var(--text); cursor: pointer; }
.task-actions-body > button:hover, .act-sub > summary:hover { background: var(--surface-2); }
.task-actions-body > button.danger { color: var(--danger); }
.act-sub > summary { list-style: none; display: block; }
.act-sub > summary::-webkit-details-marker { display: none; }
.act-form { display: flex; flex-direction: column; gap: 6px; padding: 4px 8px 8px; }
.act-form select, .act-form input:not([type=checkbox]) { width: 100%; height: 34px; padding: 0 8px; font: inherit; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.act-row { display: flex; gap: 6px; } .act-row select { flex: 1; min-width: 0; }
.task-archived { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.subtasks { margin: 4px 0 12px; }
.subtasks-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.subtasks-head h3 { margin: 0; font-size: 15px; }
.subtask-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.subtask-list li { display: flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 14px; border-top: 1px solid var(--border); background: var(--surface); }
.subtask-list li:first-child { border-top: 0; }
.subtask-list li a { color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.subtask-list li a:hover { text-decoration: underline; }
.subtask-list li.st-done a, .subtask-list li.st-checked a, .subtask-list li.is-archived a { color: var(--muted); }
.subtask-list li.st-cancel a { color: var(--muted); text-decoration: line-through; }
.subtask-list li.st-new, .subtask-list li.st-work, .subtask-list li.st-done, .subtask-list li.st-checked, .subtask-list li.st-cancel { background: var(--surface); color: inherit; text-decoration: none; }
.sub-count { font-size: 11px; color: var(--muted); }
.board-archive-link { align-self: center; margin-right: 8px; }
/* комментарии (сессия 23) */
.comments { margin: 6px 0 10px; }
.comments-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.comments-head h3 { margin: 0; font-size: 15px; }
.comment-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.comment { display: flex; gap: 10px; align-items: flex-start; }
.comment-body { flex: 1; min-width: 0; }
.comment-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 13px; }
.comment-text { margin-top: 3px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius-sm); }
.comment-text a { color: var(--brand); }
.mention { color: var(--brand); font-weight: 600; }
.comment-new textarea, .comment-edit textarea { width: 100%; padding: 8px 10px; font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); resize: vertical; }
.comment-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.comment-edit { margin-top: 4px; }
.link-btn.danger { color: var(--danger); }
/* файлы (сессия 24) */
.files { margin: 4px 0 12px; border-radius: var(--radius-sm); }
.files.is-drop { outline: 2px dashed var(--brand); outline-offset: 4px; }
.files-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.files-head h3 { margin: 0; font-size: 15px; }
.file-pick { cursor: pointer; color: var(--brand); }
.file-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.file-list.compact { margin-top: 6px; }
.file { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); min-width: 0; }
.file-thumb img { display: block; width: 44px; height: 44px; object-fit: cover; border-radius: 4px; }
.file-ext { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 4px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 700; }
.file-info { flex: 1; min-width: 0; font-size: 13px; }
.file-info > a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.files-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.comment-attach { cursor: pointer; font-size: 16px; }
/* метки, чек-листы, история (сессия 25) */
.labels { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 14px; }
.label-chip, .label-pick, .card-label { display: inline-flex; align-items: center; min-height: 22px; min-width: 40px; padding: 0 8px; border-radius: 4px; background: var(--lb); color: var(--lf); font-size: 12px; font-weight: 600; border: 0; }
.label-menu { position: relative; }
.label-menu > summary { list-style: none; cursor: pointer; font-size: 13px; color: var(--muted); padding: 2px 8px; border: 1px dashed var(--border); border-radius: 4px; }
.label-menu > summary::-webkit-details-marker { display: none; }
.label-menu-body { position: absolute; left: 0; top: 30px; z-index: 30; width: 280px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.18); display: flex; flex-direction: column; gap: 6px; }
.label-row { display: flex; gap: 6px; align-items: center; }
.label-pick { flex: 1; cursor: pointer; justify-content: flex-start; min-height: 28px; }
.label-pick.is-on { box-shadow: inset 0 0 0 2px rgba(0,0,0,.35); }
.label-new { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--border); padding-top: 8px; }
.label-new input[name=title] { height: 32px; padding: 0 8px; font: inherit; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.label-colors { display: flex; flex-wrap: wrap; gap: 6px; }
.label-colors label { cursor: pointer; }
.label-colors input { position: absolute; opacity: 0; }
.label-colors span { display: block; width: 32px; height: 22px; border-radius: 4px; }
.label-colors input:checked + span { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.card-labels { display: flex; flex-wrap: wrap; gap: 4px; position: relative; z-index: 1; pointer-events: none; }
.card-label { min-height: 8px; min-width: 32px; padding: 0 6px; font-size: 10px; line-height: 16px; }
.card-label:empty { height: 8px; min-height: 8px; }
.checklists { display: flex; flex-direction: column; gap: 12px; margin: 4px 0 12px; }
.checklist-head { display: flex; align-items: center; gap: 8px; }
.checklist-head h3 { margin: 0; font-size: 15px; }
.cl-progress { height: 4px; background: var(--surface-2); border-radius: 2px; margin: 6px 0; overflow: hidden; }
.cl-progress span { display: block; height: 100%; background: #61bd4f; }
.cl-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.cl-items li { display: flex; align-items: center; gap: 6px; padding: 3px 0; }
.cl-items li .check { flex: 1; align-items: center; }
.cl-items li.is-done .check span { color: var(--muted); text-decoration: line-through; }
.cl-add input, .cl-new input, .cl-new textarea { width: 100%; padding: 6px 8px; font: inherit; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.cl-add { margin-top: 4px; }
.cl-new summary { cursor: pointer; color: var(--muted); list-style: none; }
.cl-new summary::-webkit-details-marker { display: none; }
.cl-new form { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.sub-count.is-complete { color: #1e7b34; }
.task-history { margin: 6px 0 0; }
.task-history > summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.history { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; max-height: 320px; overflow-y: auto; }
/* «Делаю / Контролирую» (сессия 26) */
.mytasks-toggle { gap: 6px; position: relative; }
.mytasks-toggle .badge { position: static; margin-left: 2px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(420px, 100vw); background: var(--surface); border-left: 1px solid var(--border); box-shadow: -8px 0 30px rgba(0,0,0,.15); display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px 14px; }
.mytasks-tabs { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.mytasks-tabs [data-mytasks-tab] { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 10px; font: inherit; font-size: 15px; color: var(--muted); cursor: pointer; margin-bottom: -1px; }
.mytasks-tabs [data-mytasks-tab].is-active { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }
.mytasks-tabs sup { color: var(--danger); font-weight: 700; }
.mytasks-settings { position: relative; }
.mytasks-settings > summary { list-style: none; cursor: pointer; color: var(--muted); padding: 4px 6px; }
.mytasks-settings > summary::-webkit-details-marker { display: none; }
.mytasks-settings-body { position: absolute; right: 0; top: 30px; z-index: 5; width: 240px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.18); display: flex; flex-direction: column; gap: 6px; }
.mytasks-scope { width: 100%; height: 32px; margin-bottom: 10px; padding: 0 8px; font: inherit; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.mytasks-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mytasks-list li { padding: 8px 4px 8px 10px; border-bottom: 1px solid var(--border); border-left: 3px solid transparent; }
.mytasks-list li.is-priority { border-left-color: var(--danger); }
.mytasks-list li > a { color: var(--text); text-decoration: none; font-size: 14px; overflow-wrap: anywhere; }
.mytasks-list li > a:hover { text-decoration: underline; }
.mytasks-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 3px; }
.mytasks-foot { position: sticky; bottom: -12px; z-index: 3; padding: 12px 0; background: var(--surface); }
.mytasks-foot .btn { width: 100%; justify-content: center; }
.mytasks-empty { padding: 12px 0; }
.mytasks-page { max-width: 720px; }
.quick-where select { width: 100%; height: 36px; padding: 0 8px; font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
/* матрица, отчёт, рейтинг (сессия 27) */
.mytasks-links { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }
.eh { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.eh-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.eh-axis { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-weight: 700; font-size: 13px; text-align: center; }
.eh-hot { color: #cc0000; } .eh-cool { color: #059691; }
.eh-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 220px; }
.eh-col h2 { margin: 0 0 8px; font-size: 14px; }
.eh-q1 { border-top: 4px solid #cc0000; } .eh-q2 { border-top: 4px solid #e8a400; } .eh-q3 { border-top: 4px solid #2f7bd0; } .eh-q4 { border-top: 4px solid #059691; }
.eh-list { display: flex; flex-direction: column; gap: 6px; min-height: 160px; }
.eh-list.is-over { outline: 2px dashed var(--brand); outline-offset: 2px; border-radius: var(--radius-sm); }
.eh-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 14px; cursor: grab; }
.eh-num { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 18px; padding: 0 4px; border-radius: 4px; font-size: 11px; font-weight: 800; color: #fff; letter-spacing: .3px; } /* номер квадрата (с. 49) */
.eh-num-1 { background: #cc0000; } .eh-num-2 { background: #c98a00; } .eh-num-3 { background: #2f7bd0; } .eh-num-4 { background: #059691; }
.eh-col h2 .eh-num { vertical-align: 1px; margin-right: 4px; }
.eh-card.is-priority { border-left: 3px solid var(--danger); }
.eh-card > a { color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.eh-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.eh-move { margin-top: 6px; width: 100%; height: 26px; font: inherit; font-size: 12px; color: var(--muted); background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm); }
@media (max-width: 900px) { .eh { grid-template-columns: 1fr; } .eh-grid { grid-template-columns: 1fr; } .eh-axis { display: none; } }
@media (pointer: fine) { .eh-move { opacity: .0; height: 0; margin: 0; padding: 0; border: 0; } .eh-card:hover .eh-move, .eh-move:focus { opacity: 1; height: 26px; margin-top: 6px; border: 1px solid var(--border); } }
.report-period { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.report-period input { height: 34px; padding: 0 8px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.report-stat h2 { margin: 0 0 10px; font-size: 16px; }
.report-stat dl { margin: 0; }
.report-stat dl > div { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); }
.report-stat dl > div.sep { margin-top: 10px; }
.report-stat dd { margin: 0; font-weight: 700; }
.v-purple { color: #7b3fbf; } .v-good { color: #1e7b34; } .v-bad { color: var(--danger); } .v-warn { color: #b26b00; } .v-blue { color: #1a56c4; }
.rating-user { display: inline-flex; align-items: center; gap: 8px; }
.rating-table td { white-space: nowrap; }
/* рамка награды у аватара */
.avatar-framed { position: relative; display: inline-flex; width: var(--av); height: var(--av); flex: none; }
.avatar-frame { position: absolute; left: 50%; top: 50%; width: calc(var(--av) * 1.5); height: calc(var(--av) * 1.5); transform: translate(-50%, -50%); pointer-events: none; max-width: none; }
.award-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.award-list li { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.award-list img { width: 48px; height: 48px; flex: none; }
.award-list .is-old img { opacity: .55; }
.rating-frame { width: 22px; height: 22px; vertical-align: -6px; }

/* ——— Колокольчик (сессия 28) ——— */
.bell-menu { position: relative; }
.bell .badge[hidden] { display: none; }
.notif-dropdown { width: min(400px, calc(100vw - 24px)); padding: 0; right: -60px; }
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.notif-dropdown .notif-list { max-height: min(60vh, 460px); overflow-y: auto; }
.notif-list { list-style: none; margin: 0; padding: 4px; }
.notif-list .notif a { display: flex; align-items: flex-start; gap: 10px; padding: 9px 8px; border-radius: 8px; color: var(--text); text-decoration: none; }
.notif-list .notif a:hover { background: var(--surface-2); }
.notif.is-unread .notif-text { font-weight: 600; }
.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; line-height: 1.35; overflow-wrap: anywhere; }
.notif-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); color: var(--muted); }
.notif-icon svg { width: 16px; height: 16px; }
.notif-task_mention .notif-icon, .notif-icon.notif-task_mention, .notif-icon.notif-task_assigned { background: var(--brand-soft); color: var(--text); }
.notif-icon.notif-task_due { background: var(--danger-soft); color: var(--danger); }
.notif-icon.notif-award { background: color-mix(in srgb, #d4a017 18%, transparent); color: #a07a00; }
.notif-dot { flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--accent); }
.notif-empty { padding: 14px 12px; margin: 0; }
.notif-foot { padding: 8px 12px; border-top: 1px solid var(--border); font-size: 13px; }
.notif-dropdown .notif-foot a, .notif-dropdown .notif-list a { width: auto; }
.notif-dropdown .notif-foot a { display: inline; padding: 0; }
.notif-dropdown .notif-head button { width: auto; display: inline; padding: 0; color: var(--brand); }
.notif-page .notif + .notif { border-top: 1px solid var(--border); }
.pager { display: flex; gap: 14px; align-items: center; justify-content: center; margin-top: 12px; }
.kinds-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.kinds-list label { display: flex; gap: 8px; align-items: flex-start; }
@media (max-width: 640px) { .notif-dropdown { position: fixed; left: 12px; right: 12px; top: var(--bell-top, 64px); width: auto; } }
.notif-dropdown { z-index: 60; }
/* Рамка выступает за аватар на четверть — оставляем ей место */
.profile-head .avatar-framed { margin: calc(var(--av) * .2); margin-left: calc(var(--av) * .1); }
.user-menu .avatar-framed, .topbar .avatar-framed { margin: 0 6px; }
@media (max-width: 640px) { .topbar .avatar-frame { display: none; } .topbar .avatar-framed { margin: 0; } }

/* Выгрузка линии (сессия 29) */
.line-export { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding-top: 8px; border-top: 1px solid var(--border); }
.line-export > span { grid-column: 1 / -1; }
.line-export .btn { height: 32px; padding: 0 8px; font-size: 13px; justify-content: center; }
.files-head .small + .file-pick { margin-left: 12px; }

/* Повтор задачи (сессия 30) */
.periodical { margin: 10px 0; }
.periodical > summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.periodical > summary strong { color: var(--text); font-weight: 600; }
.periodical-form { display: grid; gap: 8px; margin-top: 8px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.periodical-form > div:last-child { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.periodical-custom { display: grid; gap: 8px; }
.periodical-custom[hidden] { display: none; }
.periodical-days { display: flex; gap: 4px; flex-wrap: wrap; }
.day-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; cursor: pointer; }
.day-chip:has(input:checked) { background: var(--brand-soft); border-color: var(--brand); }
.num-input { width: 72px; }
.periodical-note { margin: 8px 0; }
.card-periodical { color: var(--muted); font-size: 12px; }
.periodical-form select, .periodical-form input[type="date"], .periodical-form input[type="number"] { width: auto; height: 32px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.periodical-form > select { max-width: 100%; }
.periodical-form .inline-fields { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Общение — см. блок «С. 57» в конце файла */
/* Объявления (сессия 34) */
.ann-cats { margin-top: 12px; }
.ann-cats .chip { height: 30px; padding: 0 12px; font-size: 13px; color: var(--text); border: 1px solid var(--border); background: var(--surface); text-decoration: none; }
.ann-cats .chip:hover { border-color: var(--brand); text-decoration: none; }
.ann-cats .chip.is-on { background: var(--brand); border-color: var(--brand); color: var(--brand-text); }
.ann-feed { max-width: 760px; }
.ann-card { display: grid; gap: 8px; }
.ann-head { display: flex; align-items: center; gap: 10px; }
.ann-who { min-width: 0; }
.ann-who a { color: var(--text); }
.ann-menu { position: relative; }
.ann-menu .dropdown { right: 0; left: auto; min-width: 200px; }
.ann-menu .dropdown .danger { color: var(--danger); }
.ann-title { margin: 4px 0 0; font-size: 18px; }
.ann-title a { color: var(--text); }
.ann-text { line-height: 1.55; overflow-wrap: anywhere; }
.ann-text.is-clamped { max-height: 9.3em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.ann-more { justify-self: start; font-size: 14px; }
.ann-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.ann-images a { display: block; border-radius: 8px; overflow: hidden; background: var(--surface-2); aspect-ratio: 4 / 3; }
.ann-images img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ann-images.is-single { grid-template-columns: 1fr; }
.ann-images.is-single a { aspect-ratio: auto; max-height: 420px; }
.ann-images.is-single img { object-fit: contain; max-height: 420px; }
.ann-files { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.ann-foot { display: flex; gap: 16px; align-items: center; }
.ann-foot span { display: inline-flex; gap: 4px; align-items: center; }
.ann-foot .icon { width: 16px; height: 16px; }
.ann-more-wrap { text-align: center; margin-top: 12px; }
.ann-filter { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; max-width: 760px; }
.ann-filter .form-actions { margin-top: 0; }
.ann-table .ann-table-title { white-space: normal; min-width: 220px; }
.ann-row-actions { display: flex; gap: 12px; align-items: center; }
.ann-row-actions form { margin: 0; }
.ann-form { max-width: 760px; }
.ann-rules { margin-top: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--info-soft); font-size: 14px; white-space: pre-line; }
.ann-rules strong { display: block; margin-bottom: 2px; }
.ann-existing { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 4px; font-size: 14px; }
.ann-existing li { display: flex; gap: 10px; align-items: center; }
.ann-existing .check { font-size: 13px; color: var(--muted); }
.ann-schedule { margin-top: 16px; }
.ann-schedule .field { margin-top: 8px; max-width: 320px; }
.ann-cat-card { display: flex; gap: 12px; align-items: flex-start; }
.ann-cat-form { flex: 1; min-width: 0; }
.ann-cat-side { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.ann-cat-side form { margin: 0; }
@media (max-width: 640px) {
    .ann-filter { grid-template-columns: 1fr; }
    .ann-cat-card { flex-direction: column; }
    .ann-cat-side { flex-direction: row; }
}
.ann-admin-filter { grid-template-columns: 2fr 1fr 1fr auto; }
@media (max-width: 860px) { .ann-admin-filter { grid-template-columns: 1fr 1fr; } .ann-admin-filter .grow-2 { grid-column: 1 / -1; } }
@media (max-width: 640px) { .ann-admin-filter { grid-template-columns: 1fr; } }

/* Редактор объявлений и оформленный текст (доработка сессии 34) */
.rte { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.rte:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: 6px; border-bottom: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius-sm) var(--radius-sm) 0 0; position: sticky; top: var(--topbar-h); z-index: 5; }
.rte-bar[hidden] { display: none; }
.rte-bar button { min-width: 32px; height: 32px; padding: 0 6px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text); font: inherit; font-size: 15px; cursor: pointer; }
.rte-bar button:hover { background: var(--surface); border-color: var(--border); }
.rte-bar button.is-on { background: var(--brand); color: var(--brand-text); }
.rte-bar select { height: 32px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; padding: 0 6px; }
.rte-sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.rte-area { min-height: 260px; max-height: 70vh; overflow-y: auto; padding: 12px 14px; outline: none; }
.rte-area[hidden] { display: none; }
.rte textarea[data-rte-input] { width: 100%; min-height: 220px; border: 0; padding: 10px 12px; font: inherit; background: transparent; color: var(--text); }
.rte-status { padding: 6px 12px; border-top: 1px solid var(--border); }
.rte-status.error { color: var(--danger); }
.ann-text p { margin: 0 0 .7em; }
.ann-text > :last-child { margin-bottom: 0; }
.ann-text h2 { font-size: 20px; margin: .8em 0 .4em; }
.ann-text h3 { font-size: 17px; margin: .8em 0 .4em; }
.ann-text h4 { font-size: 15px; margin: .8em 0 .4em; }
.ann-text ul, .ann-text ol { margin: 0 0 .7em; padding-left: 1.6em; }
.ann-text blockquote { margin: 0 0 .7em; padding: 6px 12px; border-left: 3px solid var(--border); color: var(--muted); }
.ann-text img, .ann-text video { max-width: 100%; height: auto; border-radius: 6px; display: inline-block; vertical-align: top; }
.ann-text video { display: block; max-height: 480px; background: #000; }
.ann-text table { border-collapse: collapse; margin: 0 0 .7em; max-width: 100%; display: block; overflow-x: auto; }
.ann-text td, .ann-text th { border: 1px solid var(--border); padding: 4px 8px; min-width: 40px; vertical-align: top; }
.ann-text hr { border: 0; border-top: 1px solid var(--border); margin: 1em 0; }
.ann-text.is-clamped { max-height: 16em; }
.rte-bar select, .field .rte-bar select { width: auto; height: 32px; }

/* Оценки и комментарии объявлений (сессия 35) */
.ann-foot { flex-wrap: wrap; gap: 8px; }
.ann-foot form, .ann-c-foot form { margin: 0; }
.ann-mark { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; }
.ann-mark span { color: var(--muted); font-weight: 600; }
.ann-mark:hover { text-decoration: none; border-color: var(--brand); }
.ann-mark.is-static { cursor: default; }
.ann-mark.is-static:hover { border-color: var(--border); }
a.ann-mark.is-static { cursor: pointer; }
.ann-mark.is-good.is-on { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.ann-mark.is-bad.is-on { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.ann-mark.is-on span { color: inherit; }
.ann-mark.small { height: 26px; padding: 0 8px; font-size: 12px; }
.ann-views { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.ann-views .icon { width: 16px; height: 16px; }
.ann-comments { margin-top: 12px; }
.ann-comments h2 { font-size: 17px; }
.ann-c-form textarea { width: 100%; padding: 10px 12px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); resize: vertical; }
.ann-c-form textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.ann-c-form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 6px; }
.ann-c-form-actions span { margin-right: auto; }
.ann-c { padding: 12px 0 0; border-top: 1px solid var(--border); margin-top: 12px; }
.ann-c-children .ann-c { border-top: 0; margin-top: 6px; padding-top: 6px; }
.ann-c-head { display: flex; gap: 8px; align-items: center; }
.ann-c-head a { color: var(--text); }
.ann-c-text { margin: 6px 0 0 38px; line-height: 1.5; overflow-wrap: anywhere; }
.ann-c-reply-to { display: block; margin: 6px 0 0 38px; padding: 4px 8px; border-left: 3px solid var(--ok); background: var(--surface-2); border-radius: 0 6px 6px 0; font-size: 13px; color: var(--muted); text-decoration: none; }
.ann-c-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 0 38px; }
.ann-c-replybox { margin: 8px 0 0 38px; }
.ann-c-children { margin-left: 30px; }
@media (max-width: 640px) { .ann-c-children { margin-left: 12px; } .ann-c-text, .ann-c-foot, .ann-c-replybox, .ann-c-reply-to { margin-left: 0; } }
.ok { color: var(--ok); } .danger-text { color: var(--danger); }

/* Главная (сессия 36) */
.home-grid { grid-template-columns: minmax(0, 1fr) 380px; }
.home-feed-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.home-cat select { height: 40px; padding: 0 10px; font: inherit; font-weight: 700; font-size: 16px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); max-width: 100%; }
.home-feed .ann-feed { max-width: none; }
.home-side { position: sticky; top: calc(var(--topbar-h) + 12px); }
.home-mytasks .mytasks-list { max-height: 60vh; overflow-y: auto; }
@media (max-width: 1100px) { .home-grid { grid-template-columns: minmax(0, 1fr); } .home-side { position: static; order: -1; } }

/* ЭДО — раздел «Документы» (сессия 38): меню слева, дерево номенклатуры и форма справа */
.docs-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.docs-layout > * { min-width: 0; }
.docs-side { display: grid; gap: 12px; align-content: start; }
.docs-menu { display: grid; gap: 2px; padding: 8px; }
.docs-menu a, .docs-menu-soon { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text); font-weight: 600; }
.docs-menu a:hover { background: var(--surface-2); text-decoration: none; }
.docs-menu a.is-active { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--brand); }
.docs-menu-soon { color: var(--muted); cursor: default; }
.docs-menu-soon .chip { margin-left: auto; }
.small-title { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 8px; }
.docs-filter .small-title + * { margin-bottom: 14px; }
.docs-types-compact li { padding: 3px 0; font-size: 14px; }
.docs-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
.docs-tree { list-style: none; margin: 0; padding: 0; }
.docs-tree .docs-tree { margin-left: 14px; padding-left: 10px; border-left: 1px dashed var(--border); }
.docs-tree-root { margin-top: 14px; }
.docs-tree-row { display: flex; align-items: center; gap: 4px; border-radius: var(--radius-sm); }
.docs-tree-row:hover { background: var(--surface-2); }
.docs-tree-row.is-active { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--brand); }
.docs-tree-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
a.docs-tree-item:hover { text-decoration: none; }
.docs-tree-item .icon { flex: none; color: var(--muted); }
.docs-tree-compact .docs-tree-item { padding: 3px 0; font-size: 14px; }
.docs-tree-tools { display: inline-flex; flex: none; opacity: .55; }
.docs-tree-row:hover .docs-tree-tools, .docs-tree-row:focus-within .docs-tree-tools { opacity: 1; }
.docs-tree-tools form { margin: 0; }
.docs-form-card h2 { margin-top: 0; overflow-wrap: anywhere; }
.docs-form-card textarea { resize: vertical; }
.docs-delete { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); }
.docs-main { min-height: 260px; }
.req { color: var(--danger); }
@media (max-width: 1100px) {
    .docs-split { grid-template-columns: 1fr; }
    .docs-split.has-form .docs-form-card { order: -1; } /* на узком экране открытая форма — сверху */
}
@media (max-width: 760px) {
    .docs-layout { grid-template-columns: 1fr; }
    .docs-layout .docs-filter-wrap > summary { display: inline-flex; margin-bottom: 8px; }
    .docs-filter-wrap:not([open]) > .docs-filter { display: none; }
    .docs-menu { grid-auto-flow: column; overflow-x: auto; overflow-y: hidden; }
    .docs-menu a, .docs-menu-soon { white-space: nowrap; }
    .docs-tree-tools { opacity: 1; }
}

/* ЭДО — документы (сессия 39): список, форма, карточка */
.docs-crumb { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; }
.docs-filter a.docs-tree-item { border-radius: var(--radius-sm); padding: 4px 6px; margin: 0 -6px; }
.docs-filter a.docs-tree-item:hover { background: var(--surface-2); text-decoration: none; }
.docs-filter a.docs-tree-item.is-active { background: var(--surface-2); font-weight: 600; }
.docs-table td { vertical-align: top; white-space: normal; }
.docs-table td.nowrap { white-space: nowrap; }
.docs-table td.docs-col-title { min-width: 240px; }
.docs-table td.docs-col-authors, .docs-table td.docs-col-addressees, .docs-table td.docs-col-description { min-width: 180px; }
.docs-table .pre { white-space: pre-line; }
.docs-table tr.is-expired td { color: var(--muted); }
.docs-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.docs-cols-dialog { width: min(560px, calc(100vw - 24px)); overflow-y: auto; }
.docs-cols-dialog h2 { margin: 0 0 4px; }
.docs-cols-list { list-style: none; margin: 10px 0; padding: 0; max-height: 46vh; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.docs-cols-list li { display: flex; align-items: center; gap: 4px; padding: 2px 6px 2px 10px; border-bottom: 1px solid var(--border); color: var(--muted); }
.docs-cols-list li:last-child { border-bottom: 0; }
.docs-cols-list li.is-on { color: var(--text); }
.docs-cols-sort { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.docs-cols-sort select { flex: 1 1 200px; height: 38px; padding: 0 8px; font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.docs-sort { color: inherit; text-decoration: none; white-space: nowrap; }
.docs-sort:hover { text-decoration: underline; }
.docs-pick { max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 10px; }
.docs-pick-filter { margin-bottom: 6px; }
.field .docs-check { display: flex; font-weight: 400; margin: 0; font-size: 14px; color: var(--text); }
.docs-pick input[type=checkbox] { width: 18px; height: 18px; padding: 0; margin: 0; flex: none; accent-color: var(--brand); }
.docs-tree-item .chip { white-space: nowrap; flex: none; }
.docs-role-name { display: flex; flex-direction: column; min-width: 0; }
fieldset.field { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
fieldset.field legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }
.docs-check { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 14px; cursor: pointer; }
.docs-period { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.docs-period span { display: none; }
.docs-period input, .docs-filter input:not([type=checkbox]), .docs-filter select { min-width: 0; width: 100%; }
.docs-check input { flex: none; width: auto; }
.docs-filter-wrap > summary { display: none; }
.docs-filter .field { margin-bottom: 12px; }
.docs-filter .small-title { display: block; }
.doc-nav { display: grid; gap: 2px; padding: 8px; }
.doc-nav .btn { justify-content: flex-start; }
.doc-v4 dt { color: var(--muted); }
.docs-table .chip { margin-left: 6px; }
.nowrap { white-space: nowrap; }
.doc-form > .card { margin-bottom: 16px; }
.doc-form h2 { margin-top: 0; font-size: 18px; }
.doc-form textarea { min-height: 0; }
.field-wide { grid-column: 1 / -1; }
.doc-parties + .doc-parties { margin-top: 18px; }
.doc-parties-head { margin-bottom: 6px; }
.doc-party { display: grid; grid-template-columns: 1.3fr 1fr 1fr auto; gap: 8px; margin-bottom: 8px; }
.doc-more > summary { cursor: pointer; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; list-style: none; }
.doc-more > summary::-webkit-details-marker { display: none; }
.doc-more > summary h2 { margin: 0; }
.doc-more[open] > summary { margin-bottom: 14px; }
.doc-files-edit li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 4px 0; }
.doc-view { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.doc-title { font-size: 17px; font-weight: 600; margin: 0 0 14px; white-space: pre-line; overflow-wrap: anywhere; }
.doc-props { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 6px 14px; margin: 0 0 16px; }
.doc-props dt { color: var(--muted); font-size: 14px; }
.doc-props dd { margin: 0; overflow-wrap: anywhere; }
.doc-props dd.pre { white-space: pre-line; }
.doc-pdf-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.doc-pdf-frame { width: 100%; height: 72vh; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.doc-files li { display: flex; align-items: center; gap: 8px; padding: 5px 0; flex-wrap: wrap; }
@media (max-width: 760px) {
    .doc-party { grid-template-columns: 1fr auto; }
    .doc-party input { grid-column: 1; }
    .doc-party [data-doc-party-remove] { grid-column: 2; grid-row: 1; }
    .doc-props { grid-template-columns: 1fr; gap: 2px; }
    /* Журнал документов на телефоне — карточками: у каждого поля подпись (data-label) */
    .docs-table thead { display: none; }
    .docs-table, .docs-table tbody { display: block; }
    .docs-table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--border); }
    .docs-table tr:last-child { border-bottom: 0; }
    .docs-table td { display: block; padding: 1px 0; border: 0; min-width: 0 !important; }
    .docs-table td:empty, .docs-table td:has(> .pre:empty) { display: none; }
    .docs-table td::before { content: attr(data-label) ': '; color: var(--muted); font-size: 13px; }
    .docs-table td.docs-col-title::before { content: none; }
    .docs-table td.docs-col-title { font-weight: 600; margin: 2px 0; }
    .docs-table td.nowrap { white-space: normal; overflow-wrap: anywhere; }
    .doc-props dd { margin-bottom: 8px; }
}

/* Шапка на узком телефоне (сессия 39): кнопка профиля не вылезает за край, когда у «Задач» есть счётчик */
@media (max-width: 420px) {
    .topbar { gap: 2px; padding-left: 8px; padding-right: 8px; }
    .topbar .btn-ghost { padding-left: 6px; padding-right: 6px; }
    .topbar .logo svg { max-width: 104px; }
}
/* ЭДО, сессия 42: связи документа, обсуждение, документы в задаче */
.doc-rel, .doc-discussion { grid-column: 1 / -1; }
.doc-rel { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.doc-rel .card { min-width: 0; }
.doc-rel-item { padding: 6px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.doc-rel-item:last-of-type { border-bottom: 0; }
.doc-rel-row { display: flex; gap: 8px; align-items: center; }
.doc-pick { position: relative; margin-top: 8px; }
.doc-pick input[type=search] { width: 100%; height: 38px; padding: 0 10px; font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.doc-pick-list { list-style: none; margin: 4px 0 0; padding: 0; max-height: 280px; overflow-y: auto; }
.doc-pick-list:empty { display: none; }
.doc-pick-list li button { display: block; width: 100%; text-align: left; padding: 7px 10px; font: inherit; font-size: 13px; color: var(--text); background: var(--surface-2); border: 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.doc-pick-list li button:hover, .doc-pick-list li button:focus { background: var(--surface); outline: 2px solid var(--brand); outline-offset: -2px; }
.doc-pick-list li.muted { padding: 6px 10px; font-size: 13px; }
.dc-list { list-style: none; margin: 0; padding: 0; }
.dc { padding: 10px 0; border-bottom: 1px solid var(--border); }
.dc-replies { margin-left: 22px; border-left: 2px solid var(--border); padding-left: 12px; }
.dc-replies .dc:last-child { border-bottom: 0; }
.dc-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.dc-text { margin: 4px 0; overflow-wrap: anywhere; }
.dc-actions { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.dc-actions form { display: inline; }
.dc-reply > summary { list-style: none; }
.dc-reply > summary::-webkit-details-marker { display: none; }
.dc-reply[open] { flex-basis: 100%; }
.dc-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.dc-form textarea { flex: 1; min-width: 0; padding: 8px 10px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); resize: vertical; }
.task-docs { margin-top: 18px; }
.task-doc-list { list-style: none; margin: 6px 0 0; padding: 0; }
.task-doc-list li { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); }
.task-doc-list li .grow { min-width: 0; overflow-wrap: anywhere; display: flex; flex-direction: column; }
.doc-share-head { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
@media (max-width: 760px) { .dc-form { flex-direction: column; align-items: stretch; } .dc-replies { margin-left: 8px; } }
/* ЭДО, сессия 43: загрузка платёжных поручений */
.doc-import-row { padding: 8px 0; border-bottom: 1px solid var(--border); }
.doc-import-row > summary { cursor: pointer; overflow-wrap: anywhere; }
.doc-import-row .list { margin: 8px 0 0 18px; }
/* Общение, сессия 43: смайлики и реакции */
.emoji-panel { position: fixed; z-index: 60; width: min(340px, calc(100vw - 16px)); max-height: 360px; overflow-y: auto; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(0, 0, 0, .18); }
.emoji-panel button[data-emoji] { width: 36px; height: 36px; font-size: 22px; line-height: 1; padding: 0; border: 0; background: none; border-radius: 6px; cursor: pointer; }
.emoji-panel button[data-emoji]:hover, .emoji-panel button[data-emoji]:focus-visible { background: var(--surface-2); }
.emoji-quick { display: flex; flex-wrap: wrap; gap: 2px; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, 36px); gap: 2px; justify-content: space-between; }
.emoji-cap { font-size: 12px; color: var(--muted); margin: 2px 0 4px; }
.emoji-recent { margin-bottom: 6px; }
.emoji-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0 6px; }
.emoji-tabs button { font: inherit; font-size: 12px; padding: 3px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); cursor: pointer; }
.emoji-tabs button.is-active { color: var(--text); border-color: var(--text); }
.chat-emoji-btn { font-size: 20px; }
.chat-reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chat-reaction { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; font: inherit; font-size: 14px; line-height: 1.5; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); cursor: pointer; }
.chat-reaction span { font-size: 12px; color: var(--muted); }
.chat-reaction.is-mine { border-color: var(--brand); background: var(--surface-2); }
.chat-reaction:disabled { cursor: default; }
.chat-actions .link-btn { white-space: nowrap; }
/* Тарифы (сессия 44) */
.billing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; margin-bottom: 16px; }
.billing-plan { font-size: 20px; font-weight: 700; margin: 0 0 8px; }
.billing-usage { grid-template-columns: 150px minmax(0, 1fr); }
.billing-calc { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.billing-calc label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.billing-calc input, .billing-calc select { height: 38px; padding: 0 8px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); width: 140px; }
.billing-sum { flex-basis: 100%; margin: 4px 0 0; font-size: 18px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 16px; align-items: stretch; }
.plan h2 { margin: 0 0 6px; }
.plan-price { font-size: 26px; font-weight: 700; margin: 0; }
.plan-main { border: 2px solid var(--text); }
.plan-list { margin: 12px 0; padding-left: 18px; }
.plan-list li { margin: 4px 0; }
.billing-banner { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* Счета, акты, «Оплаты и чеки» — сессия 46 */
.billing-invoice { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.billing-invoice .radio { display: flex; align-items: center; gap: 6px; flex-basis: 100%; font-size: 14px; }
.billing-invoice [data-plan-fields] { display: flex; flex-wrap: wrap; gap: 10px; }
.billing-invoice [data-plan-fields][hidden] { display: none; }
.billing-invoice label:not(.radio) { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.billing-invoice input[type=number], .billing-invoice select { height: 38px; padding: 0 8px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); width: 140px; }
.billing-invoice select[name=seats] { width: 240px; }
.billing-invoices { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; font-size: 14px; }
.invoice-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.invoice-status { padding: 2px 8px; border-radius: 999px; font-size: 13px; background: var(--surface-2, #f2f2f2); }
.invoice-status.is-paid { background: #e6f4ea; color: #1e6b34; }
.invoice-status.is-canceled { text-decoration: line-through; color: var(--muted); }
.pay-receipt-qr { width: 120px; height: 120px; image-rendering: pixelated; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }

/* ===== Сессия 48: вход и регистрация, гостевые страницы как в СУПРО 4, темы, Канбанчик ===== */
.btn-outline { background: transparent; border-color: var(--brand); color: var(--brand); }
.btn-outline:hover { background: var(--brand-soft); }
.btn-dark { background: #262626; border-color: #262626; color: #fff; }
.btn-dark:hover { background: #000; border-color: #000; }
:root[data-theme="dark"] .btn-dark { background: #ececec; border-color: #ececec; color: #141414; }
.btn-lg { height: 48px; padding: 0 26px; font-size: 16px; }
.btn.is-current { box-shadow: 0 0 0 3px var(--brand-soft); }

/* Меню оформления («луна») */
.theme-menu { position: relative; }
.theme-dropdown { min-width: 250px; }
.dropdown-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 6px 10px 4px; }
.theme-dropdown button { align-items: center; line-height: 1.3; }
.theme-dropdown button[aria-checked="true"] { background: var(--brand-soft); }
.theme-swatch { width: 26px; height: 26px; border-radius: 50%; flex: none; border: 1px solid rgba(0, 0, 0, .15); }
.theme-swatch-standard { background: linear-gradient(135deg, #ffffff 50%, #5d5fef 50%); }
.theme-swatch-light { background: linear-gradient(135deg, #f4f4f3 50%, #262626 50%); }
.theme-swatch-dark { background: linear-gradient(135deg, #1b1b1b 50%, #ececec 50%); }

/* Шапка гостевых страниц: логотип открывает меню страниц (как в СУПРО 4) */
.public-page { min-height: 100vh; display: flex; flex-direction: column; }
:root[data-theme="standard"] .public-page { background: #e8e8f0 url(img/gears-bg.jpg) center / cover no-repeat fixed; } /* одна картинка на весь экран — без шва (замечание Романа) */
.public-page { --footer-h: 46px; padding-bottom: var(--footer-h); }
.public-page .helper { bottom: calc(var(--footer-h) + 12px); }
.guest-top { width: 100%; max-width: 1180px; padding: 14px 16px; }
.guest-top .actions { align-items: center; }
.guest-nav { position: relative; }
.logo-menu { background: none; border: 0; cursor: pointer; gap: 6px; font: inherit; }
.logo-menu .chev { width: 16px; height: 16px; color: var(--muted); transform: rotate(90deg); }
.guest-menu { left: 0; right: auto; min-width: 300px; }
.guest-menu a { padding: 9px 12px; }

/* Подвал «Развернуть / Свернуть» — тёмный, как в СУПРО 4 */
.site-footer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #262626; color: #cfcfcf; border-top: 4px solid var(--brand); font-size: 13px; }
/* Подвал прижат к низу окна, как в СУПРО 4: «Развернуть» раскрывает его вверх, поверх страницы */
.site-footer-more { max-height: calc(100vh - 140px); overflow-y: auto; }
.footer-rights-short { display: none; }
:root[data-theme="dark"] .site-footer { background: #0c0c0c; border-top-color: #2f2f2f; }
.site-footer-inner { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.site-footer a { color: #ececec; }
.site-footer-more { display: none; grid-template-columns: 1.1fr 1.1fr .8fr; gap: 8px 32px; padding: 18px 0 6px; }
.site-footer.is-open .site-footer-more { display: grid; }
.site-footer-more > div { display: grid; gap: 10px; align-content: start; }
.site-footer-more a { display: inline-flex; align-items: center; gap: 8px; }
.site-footer-more .icon { color: #8f91ff; }
.footer-label { color: #9a9a9a; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; margin-top: 4px; }
.footer-social { display: flex; gap: 10px; }
.footer-social img, .store-badges img { display: block; }
.footer-social a:hover img, .store-badges a:hover img { opacity: .85; }
.store-badges { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.store-badges img { height: 40px; width: auto; }
.site-footer-bar { display: flex; align-items: center; gap: 16px; padding: 8px 0; flex-wrap: nowrap; min-height: 42px; }
.footer-rights { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.footer-toggle { flex: none; }
.footer-toggle { display: inline-flex; align-items: center; gap: 6px; background: #4a4a4a; color: #e6e6e6; border: 0; border-radius: 4px; padding: 5px 10px; font: inherit; font-weight: 600; cursor: pointer; }
.footer-toggle .chev { width: 14px; height: 14px; transform: rotate(-90deg); transition: transform .15s; }
.site-footer.is-open .footer-toggle .chev { transform: rotate(90deg); }
.site-footer-ver { color: #8a8a8a; }
/* С. 74: строка подвала — «Развернуть», плашка тестовой площадки (или ©), версия; права и реестр — в раскрытом подвале */
.footer-test { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--warn-soft, #fff4d6); color: var(--warn, #8a5a00); padding: 3px 10px; border-radius: 4px; font-size: 12px; }
.site-footer .footer-test a { color: var(--brand); }
.footer-copy { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-footer-bar .site-footer-ver { flex: none; white-space: nowrap; }
.footer-owner { color: #bdbdbd; font-size: 12px; line-height: 1.5; max-width: 380px; margin-top: 6px; }
.site-footer .footer-reg { color: #cfcfcf; text-decoration: underline; text-underline-offset: 2px; }
.footer-stores .store-badges { flex-direction: column; align-items: flex-start; }
:root[data-theme="light"] .footer-owner, :root[data-theme="light"] .site-footer .footer-reg { color: #4a4a4a; }
/* Канбанчик всегда над подвалом, и над раскрытым: JS пишет настоящую высоту подвала в --footer-live */
body.footer-open .helper { bottom: calc(var(--footer-live, 46px) + 12px) !important; }
@media (max-width: 600px) { .site-footer-bar .site-footer-ver { display: none; } }
body.footer-open .cookie-bar { bottom: calc(var(--footer-live, 46px) + 12px) !important; }
body.footer-open .helper > .helper-panel:not([hidden]) { max-height: calc(100vh - var(--footer-live, 46px) - 100px); }

/* Гостевая главная — как посадочная страница СУПРО 4 */
.public-main { width: 100%; }
.public-container { max-width: 1180px; margin: 0 auto; padding: 8px 16px 32px; }
.public-container > .page-narrow { padding-left: 0; padding-right: 0; }
:root[data-theme="standard"] .public-container > .page-narrow { padding: 28px 32px 36px; }
/* Посадочная страница 1.1.2 (с. 48, по лендингу Романа) */
.land { color: var(--text); }
.land h2 { font-size: 32px; line-height: 1.15; margin: 0 0 14px; font-weight: 800; }
.land h3 { font-size: 18px; margin: 0 0 8px; }
.land-wrap { max-width: 1120px; margin: 0 auto; }
.land-narrow { max-width: 780px; }
.land-section { padding: 56px 16px; background: var(--surface); }
.land-soft { background: var(--surface-2); }
.land-text { font-size: 17px; color: var(--muted); max-width: 760px; margin: 0 0 24px; }
.land-center { text-align: center; margin-left: auto; margin-right: auto; }
.land-hero { max-width: 1180px; margin: 0 auto; padding: 48px 16px 56px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 40px; align-items: center; }
.land-hero h1 { font-size: 48px; line-height: 1.05; font-weight: 900; margin: 14px 0 18px; letter-spacing: -.01em; }
.land-lead { font-size: 18px; color: var(--muted); margin: 0 0 26px; }
.land-badge { display: inline-block; padding: 6px 12px; border-radius: 999px; background: #e3f4ea; color: #1d7a45; font-weight: 700; font-size: 14px; }
:root[data-theme="dark"] .land-badge { background: #193325; color: #7fd6a2; }
.land-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.land-note { font-size: 14px; color: var(--muted); margin: 14px 0 0; }
.land-shot { margin: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: 0 18px 40px rgba(20, 20, 60, .14); background: var(--surface); }
.land-shot img { display: block; width: 100%; height: auto; }
.land-quotes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 8px 0 24px; }
.land-quotes blockquote { margin: 0; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; font-size: 17px; font-weight: 600; }
.land-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 40px; }
.land-steps li { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 36px; align-items: center; }
.land-steps li:nth-child(even) .land-step-text { order: 2; }
.land-step-num { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: var(--brand-text); font-weight: 800; font-size: 18px; margin-bottom: 12px; }
.land-step-text p { color: var(--muted); margin: 0; font-size: 16px; }
.land-features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.land-features > div { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; }
.land-features .icon { width: 30px; height: 30px; color: var(--brand); margin-bottom: 10px; }
.land-features p { color: var(--muted); margin: 0 0 12px; }
.land-kicker { display: inline-block; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 8px; }
.land-proc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 40px; align-items: start; }
.land-proc-cta { grid-column: 1 / -1; margin: 0; }
.land-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.land-checks li { position: relative; padding-left: 30px; color: var(--muted); }
.land-checks li strong { color: var(--text); }
.land-checks li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 800; display: grid; place-items: center; }
.land-prices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.land-price { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; }
.land-price-main { border: 2px solid var(--brand); }
.land-price-sum { font-size: 32px; font-weight: 800; margin: 4px 0 2px; }
.land-price-sum small { font-size: 15px; font-weight: 600; color: var(--muted); }
.land-price-sub { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.land-price ul { margin: 0 0 20px; padding-left: 18px; flex: 1; }
.land-price li { margin-bottom: 6px; }
.land-price .btn { justify-content: center; }
.land-trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.land-trust > div { display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; }
.land-trust .icon { grid-row: span 2; width: 30px; height: 30px; color: var(--brand); }
.land-trust span { color: var(--muted); font-size: 14px; }
.land-faq { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0 20px; margin-bottom: 12px; }
.land-faq summary { cursor: pointer; font-weight: 700; padding: 16px 0; font-size: 17px; }
.land-faq p { margin: 0 0 16px; color: var(--muted); }
.land-final { text-align: center; }
.land-final .land-text { margin-left: auto; margin-right: auto; }
.land-final .land-actions { justify-content: center; margin-bottom: 20px; }
.land-final .store-badges { justify-content: center; }

/* Вход, регистрация, пароль: заголовок крупно, форма на карточке, слева — Канбанчик */
.auth-wrap { max-width: 640px; width: 100%; margin: 0 auto; padding: 28px 16px 40px; }
.auth-wrap-split { max-width: 980px; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 40px; align-items: start; }
.auth-main { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 32px; }
.auth-title { font-size: 34px; font-weight: 900; text-transform: uppercase; letter-spacing: .01em; line-height: 1.1; margin-bottom: 14px; }
.auth-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.auth-buttons form { margin: 0; }
.auth-main .checks { margin-top: 0; grid-template-columns: 1fr; gap: 8px; }
.auth-main .btn-ya, .auth-main .btn-vk { width: 100%; justify-content: center; height: 44px; font-size: 16px; }
.auth-main .btn-block + .btn-block { margin-top: 8px; }
.form-wide .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-wide .form-grid > .field:nth-child(3):last-child { grid-column: 1 / 2; }
.kanban-card { margin: 0; position: sticky; top: 16px; }
.kanban-card img { display: block; width: 100%; height: auto; border-radius: 16px; box-shadow: var(--shadow); }
.kanban-say { position: relative; margin-top: 16px; background: var(--surface); border: 2px solid var(--brand); border-radius: 14px; padding: 12px 14px; font-size: 15px; line-height: 1.45; }
.kanban-say::before { content: ""; position: absolute; top: -10px; left: 36px; width: 16px; height: 16px; background: var(--surface); border-left: 2px solid var(--brand); border-top: 2px solid var(--brand); transform: rotate(45deg); }
.error-code { font-size: 56px; font-weight: 900; color: var(--brand); line-height: 1; margin-bottom: 6px; }

/* Выбор аватара при регистрации — лента со стрелками, как в СУПРО 4 */
.avatar-pick { border: 0; padding: 0; margin: 0; min-width: 0; }
.avatar-pick legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }
.avatar-carousel { display: flex; align-items: center; gap: 6px; }
.avatar-arrow { flex: none; width: 34px; height: 88px; border: 0; background: none; color: var(--brand); font-size: 40px; line-height: 1; cursor: pointer; border-radius: var(--radius-sm); }
.avatar-arrow:hover { background: var(--brand-soft); }
.avatar-strip { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px; scrollbar-width: thin; min-width: 0; flex: 1; }
.avatar-option { flex: none; scroll-snap-align: start; cursor: pointer; position: relative; }
.avatar-option input { position: absolute; opacity: 0; pointer-events: none; }
.avatar-option img { display: block; width: 88px; height: 88px; border-radius: 10px; border: 3px solid transparent; object-fit: cover; }
.avatar-option:hover img { border-color: var(--border); }
.avatar-option input:checked + img { border-color: #2b9a3d; box-shadow: 0 0 0 2px #2b9a3d; }
.avatar-option input:focus-visible + img { outline: 2px solid var(--brand); outline-offset: 2px; }
.avatar-upload { display: grid; gap: 6px; margin-top: 10px; font-size: 14px; font-weight: 600; }
.avatar-upload input { font: inherit; font-weight: 400; }
.consents { display: grid; gap: 10px; }

/* Политика, лицензия, контакты, характеристики */
.page-narrow { max-width: 860px; margin: 0 auto; padding: 28px 16px 48px; }
.page-narrow h1 { font-size: 30px; font-weight: 850; }
.page-narrow .lead { font-size: 17px; color: var(--muted); }
:root[data-theme="standard"] .page-narrow { background: var(--surface); border-radius: var(--radius); margin-top: 16px; margin-bottom: 32px; box-shadow: var(--shadow); padding: 28px 32px 36px; }
.legal-lead { font-style: italic; color: var(--muted); }
.legal-accepted { background: var(--info-soft); border-left: 4px solid var(--brand); padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 12px; }
.legal-text { line-height: 1.6; }
.legal-text h2 { margin-top: 1.4em; font-size: 19px; }
.legal-text h3 { margin-top: 1.1em; font-size: 15px; }
.legal-text ul { padding-left: 22px; margin: 0 0 .75em; }
.legal-text li { margin-bottom: 4px; }
.legal-text .legal-group-title > ul { margin-top: 4px; }
.legal-center { text-align: center; }
.legal-place { display: inline-block; margin-right: 32px; font-weight: 600; }
.legal-table { margin: 6px 0 16px; border: 1px solid var(--border); }
.legal-table th { width: 32%; white-space: normal; vertical-align: top; color: var(--text); font-size: 13px; background: var(--surface-2); }
.legal-table td { white-space: normal; font-size: 14px; }
.legal-text a { word-break: break-all; }
.contact-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0 24px; }
.contact-card { display: flex; gap: 12px; align-items: center; color: var(--text); }
.contact-card:hover { text-decoration: none; border-color: var(--brand); }
.contact-card .icon { width: 26px; height: 26px; color: var(--brand); }
.requisites th { width: 38%; white-space: normal; font-size: 13px; vertical-align: top; }
.requisites td { white-space: normal; }
.about-list { display: grid; gap: 8px; padding-left: 20px; }
.about-registry { display: flex; gap: 12px; align-items: flex-start; background: var(--info-soft); border-left: 4px solid var(--brand); padding: 12px 14px; border-radius: var(--radius-sm); margin: 4px 0 16px; }
.about-registry .icon { flex: none; width: 22px; height: 22px; color: var(--brand); margin-top: 1px; }
.about-toc { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 8px; background: var(--surface-2); }
.about-toc ol { margin: 6px 0 0; padding-left: 22px; columns: 2; column-gap: 28px; }
.about-toc li { margin: 2px 0; break-inside: avoid; }
.about-page .legal-text h2 { scroll-margin-top: 16px; }
.about-page .table th { white-space: normal; }
.about-page .table td { white-space: normal; }
.about-packages { margin: 8px 0 16px; }
.about-packages summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.about-packages .table { font-size: 13px; }
.about-demo { border: 1px dashed var(--brand); border-radius: var(--radius-sm); padding: 12px 16px; margin: 8px 0 14px; background: var(--surface); }
.about-demo p { margin: 6px 0 0; }
.about-demo code { white-space: nowrap; font-size: 15px; font-weight: 700; background: var(--surface-2); padding: 1px 6px; border-radius: 4px; }
.demo-banner { background: var(--info-soft); color: var(--text); }
@media (max-width: 600px) { .about-toc ol { columns: 1; } }
/* С. 70е: номер реестровой записи в подвале; на телефоне строка подвала — в одну линию */
@media (max-width: 860px) {
    .site-footer-bar { gap: 10px; font-size: 12px; }
    .footer-toggle > span { display: none; }
    .footer-rights-short { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
}
.footer-registry { flex: none; white-space: nowrap; color: #cfcfcf; }
.site-footer .footer-registry a { color: #cfcfcf; text-decoration: underline; text-underline-offset: 2px; }
:root[data-theme="light"] .site-footer .footer-registry a, :root[data-theme="light"] .footer-registry { color: #4a4a4a; }

/* Канбанчик — помощник в правом нижнем углу */
.helper { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.helper > * { pointer-events: auto; }
.helper-btn { width: 64px; height: 64px; border-radius: 50%; padding: 0; border: 3px solid var(--brand); background: var(--surface); cursor: pointer; overflow: hidden; box-shadow: 0 6px 18px rgba(0, 0, 0, .22); transition: transform .15s; }
.helper-btn:hover { transform: scale(1.06); }
.helper-btn img { display: block; width: 100%; height: 100%; object-fit: cover; }
.helper-bubble { position: relative; max-width: 290px; background: var(--surface); color: var(--text); border: 2px solid var(--brand); border-radius: 14px; padding: 12px 30px 12px 14px; font-size: 14px; line-height: 1.4; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); cursor: pointer; animation: helper-pop .25s ease-out; }
.helper-bubble::after { content: ""; position: absolute; right: 24px; bottom: -9px; width: 14px; height: 14px; background: var(--surface); border-right: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(45deg); }
.helper-bubble-close { position: absolute; top: 4px; right: 6px; border: 0; background: none; font-size: 18px; color: var(--muted); cursor: pointer; line-height: 1; }
@keyframes helper-pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.helper-panel { width: 360px; max-height: min(620px, calc(100vh - 110px)); display: flex; flex-direction: column; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 36px rgba(0, 0, 0, .25); overflow: hidden; }
.helper-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; background: var(--brand-soft); }
.helper-head img { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; }
.helper-head .btn { margin-left: auto; }
.helper-body { padding: 12px 14px; overflow-y: auto; }
.helper-hello { font-weight: 600; }
.helper-tips { padding-left: 18px; margin: 0 0 12px; display: grid; gap: 6px; font-size: 14px; }
.helper-search { width: 100%; height: 40px; padding: 0 12px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; }
.helper-search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.helper-faq details { border-bottom: 1px solid var(--border); padding: 7px 0; font-size: 14px; }
.helper-faq summary { cursor: pointer; font-weight: 600; }
.helper-faq p { margin: 6px 0 2px; color: var(--muted); }
.helper-foot { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 13px; }
.helper-foot .link-btn { color: var(--muted); font-size: 13px; }
.helper-show { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--brand); color: var(--brand-text); font-weight: 800; font-size: 17px; cursor: pointer; opacity: .75; box-shadow: var(--shadow); }
.helper-show:hover { opacity: 1; }
.helper [hidden] { display: none !important; }

@media (max-width: 900px) {
    .auth-wrap-split { grid-template-columns: 1fr; gap: 16px; max-width: 640px; }
    .kanban-card { position: static; display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; }
    .kanban-card img { width: 96px; border-radius: 12px; }
    .kanban-say { margin-top: 0; font-size: 14px; }
    .kanban-say::before { top: 18px; left: -10px; transform: rotate(-45deg); }
    .land-hero, .land-steps li, .land-proc { grid-template-columns: 1fr; gap: 24px; }
    .land-steps li:nth-child(even) .land-step-text { order: 0; }
    .land-prices, .land-trust { grid-template-columns: 1fr; }
    .land-hero h1 { font-size: 38px; }
    .site-footer-more { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .land-hero h1 { font-size: 30px; }
    .land h2 { font-size: 25px; }
    .land-section { padding: 40px 16px; }
    .land-quotes, .land-features, .contact-cards { grid-template-columns: 1fr; }
    .auth-main { padding: 20px 16px; }
    .auth-title { font-size: 26px; }
    .auth-buttons .btn { flex: 1 1 100%; justify-content: center; }
    .form-wide .form-grid { grid-template-columns: 1fr; }
    .hide-narrow { display: none !important; }
    .guest-menu { min-width: 260px; }
    .page-narrow, :root[data-theme="standard"] .page-narrow { padding: 20px 16px 32px; margin-top: 0; border-radius: 0; }
    .helper { right: 12px; bottom: 12px; }
    .helper-btn { width: 54px; height: 54px; }
    .helper-panel { width: calc(100vw - 24px); max-height: calc(100vh - 90px); }
    .site-footer-ver { margin-left: 0; }
    .footer-rights { display: none; }
    .footer-rights-short { display: inline; }
    .public-page .helper { bottom: calc(var(--footer-h) + 10px); }
}
@media print { .helper { display: none; } }


/* ===== С. 49: каркас как в СУПРО 4 — меню слева, «Мои задачи» справа, подвал, кнопки внизу на телефоне ===== */
:root { --taskbar-w: 340px; --footer-h: 46px; --mobilebar-h: 0px; }
.app-page { padding-bottom: var(--footer-h); }
.sidebar, .taskbar { height: calc(100vh - var(--topbar-h) - var(--footer-h)); }
.sidebar-toggle { margin-right: 2px; }

/* Стандартное оформление: боковые панели графитовые, как в СУПРО 4 */
:root[data-theme="standard"] .sidebar, :root[data-theme="standard"] .taskbar, :root[data-theme="standard"] .nav-flyout, :root[data-theme="standard"] .mobile-bar {
    --surface: #3a3a3a; --surface-2: #474747; --text: #f1f1f1; --muted: #b9b9c2; --border: #525252;
    --brand-soft: rgba(255, 255, 255, .12); --link: #b4b5ff; --info-soft: #47475c; --danger: #ff8a80; color-scheme: dark;
    background: var(--surface); color: var(--text);
}
:root[data-theme="standard"] .shell { background: none; }
:root[data-theme="standard"] .sidebar { border-right-color: #2e2e2e; }
:root[data-theme="standard"] .taskbar { border-left-color: #2e2e2e; }
:root[data-theme="standard"] .nav-link.is-active { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 3px 0 0 #8f91ff; }
.shell { background: none; }

/* Команды в меню: логотип или буква */
.nav-team > summary .team-logo { flex: none; border-radius: 6px; }
.nav-team > summary.is-current { font-weight: 650; }

/* Правая панель «Мои задачи» */
.taskbar {
    width: var(--taskbar-w); flex: none; position: sticky; top: var(--topbar-h); overflow-y: auto;
    background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column;
}
.taskbar-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 4px 16px; }
.taskbar-head strong { font-size: 16px; }
.taskbar-body { flex: 1; padding: 0 14px 12px; }
.taskbar .mytasks-foot { background: var(--surface); bottom: -12px; z-index: 3; } /* над ссылками доски в плашках (с. 49) */
.taskbar .mytasks-list li > a { color: var(--text); }
/* С. 74: панель «Мои задачи» без заголовка; верх (вкладки, ⚙, команда) и низ («Создать задачу», ссылки) всегда на виду, прокручивается перечень */
.taskbar { overflow: hidden; }
.taskbar-body { display: flex; flex-direction: column; min-height: 0; padding-top: 6px; }
.taskbar-body > .mytasks { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.taskbar .mytasks-top { flex: none; }
.taskbar .mytasks-list, .taskbar .mytasks-empty { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; margin: 0 -14px; padding: 0 14px; }
.taskbar .mytasks-list { display: block; }
.taskbar .mytasks-foot { position: static; flex: none; padding: 10px 0 0; border-top: 1px solid var(--border); }
@media (max-width: 1279px) { html.taskbar-open .helper { display: none; } }
.mytasks-st { display: inline-flex; vertical-align: -3px; margin-right: 5px; }
.mytasks-i { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-right: 5px; vertical-align: -2px; border-radius: 50%;
    font: italic 700 11px/1 Georgia, 'Times New Roman', serif; background: #2f6fe0; color: #fff; }
:root[data-theme="standard"] .mytasks-i { background: #8f91ff; color: #1f1f1f; }
:root[data-theme="dark"] .mytasks-i { background: #ff8a3d; color: #111; }
.mytasks-st .icon { width: 16px; height: 16px; }
.mytasks-board { display: inline-block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
@media (min-width: 1280px) {
    html.taskbar-off .taskbar { display: none; }
    html:not(.taskbar-off) .app-page:not(.no-taskbar) .helper { right: calc(var(--taskbar-w) + 16px); }
}
@media (max-width: 1279px) {
    .taskbar {
        position: fixed; z-index: 45; top: 0; right: 0; bottom: 0; height: auto; width: min(380px, 100vw);
        transform: translateX(105%); transition: transform .2s ease; box-shadow: -8px 0 30px rgba(0, 0, 0, .25);
    }
    html.taskbar-open .taskbar { transform: none; }
    html.taskbar-open .overlay { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(0, 0, 0, .35); }
}

/* Свёрнутое меню (только ПК) */
@media (min-width: 861px) {
    html.sidebar-mini { --sidebar-w: 68px; }
    html.sidebar-mini .sidebar { padding: 12px 8px; overflow-x: hidden; }
    html.sidebar-mini .nav-text, html.sidebar-mini .nav-team > summary .chev, html.sidebar-mini .nav-team-links { display: none; }
    html.sidebar-mini .nav-link { justify-content: center; padding: 9px 0; position: relative; gap: 0; }
    html.sidebar-mini .nav-title { height: 1px; padding: 0; margin: 6px 4px 8px; background: var(--border); }
    html.sidebar-mini .nav-link .badge { position: absolute; top: 2px; right: 4px; margin: 0; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
    html.sidebar-mini .nav-team > summary.is-current { background: var(--brand-soft); }
    html.sidebar-mini .content-inner { max-width: 1400px; }
}
.nav-flyout {
    position: fixed; z-index: 70; min-width: 220px; padding: 6px; border-radius: var(--radius);
    background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
}
.nav-flyout-title { padding: 6px 10px 8px; font-weight: 700; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.nav-flyout .nav-link { padding: 8px 10px; justify-content: flex-start !important; gap: 10px !important; }
html.sidebar-mini .nav-flyout .nav-text { display: inline; }
.nav-flyout .nav-link.sub { padding-left: 10px; }

/* Подвал рабочих страниц — тот же, что у гостевых (layouts/_guest-footer) */
.app-page .site-footer { z-index: 41; }
.app-page .helper { bottom: calc(var(--footer-h) + 12px); }
.nav-legal { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; font-size: 13px; border-top: 1px solid var(--border); }
.nav-legal a { color: var(--muted); }
.nav-legal span { color: var(--muted); font-size: 12px; }

/* Телефон: вместо подвала — кнопки «Меню / Главная / Задачи» внизу экрана */
.mobile-bar { display: none; }
@media (max-width: 860px) {
    :root { --footer-h: 0px; --mobilebar-h: 60px; }
    .app-page { padding-bottom: calc(var(--mobilebar-h) + env(safe-area-inset-bottom)); }
    .app-page .site-footer { display: none; }
    .sidebar { height: 100vh; }
    .mobile-bar {
        display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 42;
        height: calc(var(--mobilebar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
        background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -2px 10px rgba(0, 0, 0, .08);
    }
    :root[data-theme="standard"] .mobile-bar { border-top: 3px solid var(--brand); }
    .mobile-bar > * {
        position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
        background: none; border: 0; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; text-decoration: none;
    }
    .mobile-bar > .is-active, .mobile-bar > *:hover { color: var(--text); text-decoration: none; }
    .mobile-bar .icon { width: 22px; height: 22px; }
    .mobile-bar .badge { position: absolute; top: 6px; left: calc(50% + 6px); }
    .mobile-dot { position: absolute; top: 9px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
    .app-page .helper { bottom: calc(var(--mobilebar-h) + 12px); }
    /* меню и задачи выезжают над нижними кнопками — ими же и закрываются */
    .app-page .taskbar { bottom: calc(var(--mobilebar-h) + env(safe-area-inset-bottom)); z-index: 45; } /* выше затемнения (44), иначе на телефоне задачи не нажимаются */
    .app-page .sidebar { padding-bottom: calc(var(--mobilebar-h) + 16px); }
    html.taskbar-open .mobile-bar [data-taskbar-toggle], body.menu-open .mobile-bar [data-menu-toggle] { color: var(--text); }
}

/* Главная (с. 49): только лента — задачи в панели справа, приветствие у Канбанчика */
.home-grid { display: block; max-width: 960px; margin: 0 auto; }
.home-start { max-width: 960px; margin: 0 auto 16px; }

/* Перечень задач (с. 49): вся плашка открывает задачу, название — до трёх строк, сложность, доска — ссылкой */
.mytasks-item { position: relative; cursor: pointer; }
.mytasks-item:hover { background: var(--surface-2); }
.mytasks-list li > a.mytasks-title, .eh-card > a.eh-title {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; text-decoration: none;
}
.mytasks-title::after, .eh-title::after { content: ""; position: absolute; inset: 0; }
.mytasks-list li > a.mytasks-title:hover { text-decoration: none; }
.mytasks-board, .mytasks-meta .status-pill { position: relative; z-index: 1; }
.mytasks-board { color: var(--muted); }
.mytasks-board:hover { color: var(--text); }
.task-cx { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px; padding: 0 4px; border-radius: 4px; font-size: 11px; font-weight: 700; border: 1px solid var(--border); color: var(--text); }

/* Матрица (с. 49): переключение списков стрелками, как в v4 */
.icon.flip { transform: rotate(180deg); }
.eh-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.eh-scope { display: flex; align-items: center; gap: 6px; background: var(--brand); border-radius: var(--radius); padding: 4px; }
.eh-scope select { height: 34px; min-width: 240px; max-width: 60vw; padding: 0 10px; font: inherit; font-weight: 700; text-align: center; color: var(--brand-text); background: transparent; border: 0; cursor: pointer; }
.eh-scope select option { color: var(--text); background: var(--surface); }
.eh-arrow { width: 34px; height: 34px; color: var(--brand-text); background: transparent; border: 0; }
.eh-arrow:hover { background: rgba(255, 255, 255, .15); }
.eh-card { position: relative; }
.eh-card .eh-move, .eh-card .mytasks-board { position: relative; z-index: 1; }
.eh-card > a.eh-title { color: var(--text); }

/* С. 49: «Объявления» в меню аватара — счётчик там и точка на аватаре */
.avatar-wrap { position: relative; display: inline-flex; }
.avatar-dot { position: absolute; top: 0; right: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.dropdown-badge { margin-left: auto; }
/* Главная в стандартном оформлении — за лентой фон с шестерёнками, как на гостевых страницах */
/* Правило с. 49 (решение Романа 25.10): в стандартном оформлении рабочая область ВСЕХ страниц — на фоне с шестерёнками */
:root[data-theme="standard"] .app-page .content { background: #e8e8f0 url(img/gears-bg.jpg) center / cover no-repeat fixed; }

.task-search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.task-search input[type=search] { flex: 1; min-width: 220px; height: 40px; padding: 0 12px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.task-search-hint { flex-basis: 100%; }

/* Продуктивность (с. 49) */
.prod-chart { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 12px; align-items: end; height: 180px; padding: 8px 4px 0; }
.prod-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.prod-bar { width: min(56px, 100%); background: #e8a0a0; border-radius: 6px 6px 2px 2px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.prod-good { background: #9fd3ad; width: 100%; }
.prod-col.is-current .prod-bar { background: #e05a5a; }
.prod-col.is-current .prod-good { background: #2b9a4a; }
.prod-num { font-weight: 700; font-size: 14px; }
.prod-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.prod-col.is-current .prod-label { color: var(--text); font-weight: 700; }
.prod-legend { margin-top: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.prod-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.prod-key-good { background: #2b9a4a; } .prod-key-late { background: #e05a5a; }
.task-id { color: var(--muted); font-variant-numeric: tabular-nums; }

/* Подвал по оформлениям (с. 49, Роман 26.10): стандартное — графитовый с фиолетовой линией (как было, как в СУПРО 4);
   светлое — белый с красной линией; графитовое — тёмный с оранжевой линией и тенью, чтобы отделялся от страницы */
:root[data-theme="light"] .site-footer { background: #ffffff; color: #555555; border-top: 3px solid #e53935; box-shadow: 0 -2px 10px rgba(0, 0, 0, .06); }
:root[data-theme="light"] .mobile-bar { border-top: 3px solid #e53935; }
:root[data-theme="light"] .site-footer a { color: #262626; }
:root[data-theme="light"] .site-footer-more .icon { color: #262626; }
:root[data-theme="light"] .footer-label, :root[data-theme="light"] .site-footer-ver { color: #808080; }
:root[data-theme="light"] .footer-toggle { background: #ececea; color: #1f1f1f; }
:root[data-theme="dark"] .site-footer { background: #0c0c0c; border-top: 3px solid #ff8a3d; box-shadow: 0 -8px 24px rgba(0, 0, 0, .7); }
:root[data-theme="dark"] .mobile-bar { border-top: 3px solid #ff8a3d; }
/* Поиск по задачам: отбор по сотруднику (с. 49, 26.10) */
.task-search-person { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.task-search-person label { display: inline-flex; gap: 6px; align-items: center; }
.task-search-person select { height: 36px; max-width: 260px; padding: 0 8px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }

/* ——— С. 50: доска как в СУПРО 4 (3.2.4 v4) ——— */
.page-board .content-inner { max-width: none; }
.page-board .content { padding: 16px 20px 12px; }
.board-nav { display: flex; align-items: center; gap: 14px 18px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 14px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.board-nav.is-completed { background: #8a8a92; color: #fff; }
.board-nav.is-archived { background: #3a3a3a; color: #eee; }
.board-nav.is-completed a, .board-nav.is-archived a { color: #fff; }
.board-nav-info { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.board-nav-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; min-width: 0; }
.board-nav-label { font-weight: 700; }
.board-nav-gap { margin-left: 14px; }
.board-nav-title { font-weight: 700; }
.board-nav .board-gear { width: 30px; height: 30px; color: var(--brand); }
.board-nav .board-menu-wrap, .board-nav .board-tools-wrap { position: relative; }
.board-people { display: flex; flex-wrap: wrap; gap: 4px; }
.board-person { padding: 0; border: 2px solid transparent; border-radius: 50%; background: none; cursor: pointer; line-height: 0; }
.board-person[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent); }
.board-nav-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.board-search { width: 200px; height: 34px; padding: 0 12px; font: inherit; font-size: 14px; color: var(--text); background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--brand) 55%, var(--border)); border-radius: 8px; }
.board-tools-btn { color: var(--brand); font-weight: 600; gap: 6px; position: relative; }
.board-filter-dot { position: absolute; top: 4px; right: 2px; width: 8px; height: 8px; border-radius: 50%; background: #ff6a3d; }
.board-tools, .board-menu { right: 0; left: auto; width: 300px; padding: 10px; z-index: 40; max-height: 70vh; overflow-y: auto; }
.dd-title { font-weight: 700; font-size: 13px; padding: 8px 4px 4px; }
.dropdown .dd-item > summary, .line-menu-body .dd-item > summary { list-style: none; cursor: pointer; padding: 8px 10px; border-radius: 8px; }
.dd-item > summary::-webkit-details-marker { display: none; }
.dd-item > summary:hover { background: var(--surface-2); }
.dd-item[open] > summary { font-weight: 600; }
.dd-item .dd-form { padding: 4px 10px 10px; border: 0; }
.dd-link { display: flex; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.dd-link:hover { background: var(--surface-2); text-decoration: none; }
.dd-link.danger, summary.danger { color: var(--danger, #d33); }
.board-tool-check { display: flex !important; align-items: center; gap: 8px; padding: 7px 4px !important; color: var(--brand) !important; font-size: 14px; }
.board-tool-check input { accent-color: var(--brand); }
.board-label-search { width: 100%; height: 32px; margin: 4px 0 6px; padding: 0 10px; font: inherit; font-size: 14px; border: 1px solid color-mix(in srgb, var(--brand) 55%, var(--border)); border-radius: 8px; background: var(--surface); color: var(--text); }
.board-label-list { list-style: none; margin: 0 0 6px; padding: 0; }
.board-label-row { position: relative; display: flex; align-items: center; background: var(--lb); color: var(--lf); }
.board-label-row + .board-label-row { border-top: 1px solid rgba(255,255,255,.35); }
.board-label-pick { flex: 1; display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-weight: 700; font-size: 14px; cursor: pointer; }
.board-label-edit > summary { list-style: none; cursor: pointer; padding: 6px 10px; line-height: 0; }
.board-label-edit > summary::-webkit-details-marker { display: none; }
.board-label-edit[open] { position: static; }
.board-label-edit .label-form { position: absolute; left: 0; right: 0; top: 100%; z-index: 3; }
.label-form { display: flex; flex-direction: column; gap: 8px; padding: 10px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); }
.label-form input[name=title] { height: 32px; padding: 0 10px; font: inherit; font-size: 14px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); }
.label-colors { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.label-color { cursor: pointer; }
.label-color input { position: absolute; opacity: 0; }
.label-color span { display: block; height: 26px; border-radius: 4px; background: var(--lb); border: 2px solid transparent; }
.label-color input:checked + span { border-color: var(--text); box-shadow: inset 0 0 0 2px #fff; }
.label-color input:focus-visible + span { outline: 2px solid var(--brand); }
.label-form-actions { display: flex; align-items: center; justify-content: space-between; }
.board-label-new > summary { list-style: none; cursor: pointer; padding: 8px 4px; color: var(--brand); font-size: 14px; }
.board-label-new > summary::-webkit-details-marker { display: none; }

/* линии */
.page-board .board-lines { gap: 14px; min-height: 0; padding-bottom: 10px; align-items: stretch; }
.page-board .board-line { flex: 0 0 300px; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    max-height: calc(100vh - var(--topbar-h) - var(--footer-h, 40px) - 150px); min-height: 220px; overflow: hidden; box-shadow: var(--shadow); }
.page-board .line-head { margin: 0; padding: 10px 8px 10px 12px; gap: 4px; background: color-mix(in srgb, var(--brand) 13%, var(--surface)); }
.page-board .line-head h2 { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.page-board .line-count { color: var(--muted); min-width: 16px; text-align: right; }
.line-menu > summary, .line-sort > summary { list-style: none; cursor: pointer; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; color: var(--brand); padding: 0; }
.line-menu > summary::-webkit-details-marker, .line-sort > summary::-webkit-details-marker { display: none; }
.line-menu > summary:hover, .line-sort > summary:hover { background: var(--surface); }
.line-sort { position: relative; }
.line-sort .line-menu-body, .line-menu .line-menu-body { width: 250px; gap: 0; padding: 6px; top: 30px; }
.line-sort .dd-link.is-active { font-weight: 700; color: var(--brand); }
.page-board .line-shift { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.page-board .line-cards { flex: 1; gap: 0; padding: 0; overflow-y: auto; min-height: 40px; }
.line-add-task { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; font-weight: 600; color: var(--text);
    background: color-mix(in srgb, var(--brand) 13%, var(--surface)); border-top: 1px solid var(--border); }
.line-add-task:hover { text-decoration: none; background: color-mix(in srgb, var(--brand) 22%, var(--surface)); }
.board-line-new { flex: 0 0 220px; align-self: flex-start; }
.board-line-new > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 10px 8px; font-weight: 600; color: var(--text); }
.board-line-new > summary::-webkit-details-marker { display: none; }
.board-line-new form { display: flex; flex-direction: column; gap: 6px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.board-line-new input { width: 100%; height: 34px; padding: 0 10px; font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }

/* карточки */
.page-board .task-card { flex-direction: column; gap: 4px; padding: 10px 12px 8px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; }
.page-board .task-card:hover { background: color-mix(in srgb, var(--brand) 5%, var(--surface)); }
.page-board .task-card.is-priority { border-left: 0; box-shadow: inset 4px 0 0 var(--danger, #e53935); }
.task-card.is-archived { background: color-mix(in srgb, var(--muted) 18%, var(--surface)) !important; }
.task-card .task-body { width: 100%; display: flex; flex-direction: column; gap: 4px; }
.card-icons { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 8px; min-height: 18px; color: var(--muted); font-size: 12px; position: relative; z-index: 1; pointer-events: none; }
.card-icons .card-label { width: 22px; min-width: 22px; height: 10px; min-height: 10px; padding: 0; border-radius: 3px; border: 1.5px solid color-mix(in srgb, var(--lb) 70%, #000); }
.card-icons .ci { display: inline-flex; align-items: center; gap: 2px; }
.card-icons .ci .icon { width: 15px; height: 15px; }
.card-icons .ci.is-complete { color: #1e7b34; }
.ci-st-2 { color: #2f6fe0; } .ci-st-3 { color: #1e9b45; } .ci-st-4 { color: #1e7b34; } .ci-st-5 { color: var(--muted); }
.card-num { margin-left: auto; font-size: 11px; color: var(--muted); }
.card-title-row { display: flex; align-items: flex-start; gap: 8px; }
.card-title-row .task-title { flex: 1; min-width: 0; color: var(--text); font-size: 14px; line-height: 1.35; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.card-title-row .task-cx { flex: none; font-size: 12px; color: var(--muted); position: relative; z-index: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
.card-resp { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; z-index: 1; }
.page-board .task-due { align-self: center; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; color: #1e7b34; background: #e3f6e8; white-space: nowrap; position: relative; z-index: 1; }
.page-board .task-due.is-overdue { color: #c62828; background: #fde4e4; }
.page-board .task-due.is-closed { color: var(--muted); background: var(--surface-2); }
.card-subtask { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; font-size: 13px; color: var(--muted); position: relative; z-index: 2; }
.card-subtask .icon { width: 14px; height: 14px; }
.card-subtask:hover { color: var(--brand); text-decoration: none; }
.page-board .task-card.st-done .task-title, .page-board .task-card.st-checked .task-title { color: var(--muted); }
.task-card.is-filtered-out, .board-line .task-card[hidden] { display: none; }
:root[data-theme="dark"] .page-board .task-due { background: #1b3323; color: #7fd18f; }
:root[data-theme="dark"] .page-board .task-due.is-overdue { background: #45201f; color: #ff8a80; }
.board-mobile-nav { display: none; }

@media (max-width: 700px) {
    .page-board .content { padding: 10px 10px 8px; }
    .board-nav { padding: 8px 10px; gap: 8px; }
    .board-nav-info { flex-basis: 100%; }
    .board-nav-tools { width: 100%; margin: 0; }
    .board-search { flex: 1; width: auto; }
    .board-tools-btn span { display: none; }
    .board-people { display: none; }
    .board-mobile-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
    .board-mobile-nav .btn { font-size: 24px; color: var(--brand); }
    .page-board .board-lines { scroll-snap-type: x mandatory; gap: 10px; }
    .page-board .board-line { flex: 0 0 calc(100vw - 20px); scroll-snap-align: start; max-height: calc(100vh - var(--topbar-h) - 200px); }
    .board-line-new { flex-basis: calc(100vw - 20px); scroll-snap-align: start; }
    .board-tools, .board-menu { position: fixed; left: 10px; right: 10px; width: auto; top: 120px; }
}
@media (max-width: 700px) {
    .board-nav-team, .board-nav-project { display: none; }
    .board-nav-gap { margin-left: 0; }
}
.dd-item > summary { font-weight: 400 !important; font-size: 14px; color: var(--text); }
.dd-item[open] > summary { color: var(--brand); }

:root .page-board .task-card[class*="st-"] { background: var(--surface); color: var(--text); }
:root .page-board .task-card[class*="st-"]:hover { background: color-mix(in srgb, var(--brand) 5%, var(--surface)); }
.page-board .board-line-new { border: 0; background: none; padding: 0; min-height: 0; }

/* С. 50, вторая часть: линии на всю высоту окна, тонкая полоса прокрутки */
@media (min-width: 701px) {
    .page-board .content { display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h) - var(--footer-h, 40px) - var(--banner-h, 0px)); min-height: 420px; }
    .page-board .content-inner { flex: 1; min-height: 0; display: flex; flex-direction: column; width: 100%; }
    .page-board .board-lines { flex: 1; min-height: 0; }
    .page-board .board-line { max-height: none; min-height: 0; }
}
.page-board .board-lines, .page-board .line-cards { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--brand) 45%, transparent) transparent; }
.page-board .board-lines::-webkit-scrollbar { height: 6px; }
.page-board .line-cards::-webkit-scrollbar { width: 5px; }
.page-board .board-lines::-webkit-scrollbar-thumb, .page-board .line-cards::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--brand) 45%, transparent); border-radius: 3px; }
.page-board .board-lines::-webkit-scrollbar-track, .page-board .line-cards::-webkit-scrollbar-track { background: transparent; }
body:has(> .test-banner) { --banner-h: 29px; }
body:has(> .test-banner):has(> .impersonation-bar) { --banner-h: 70px; }

/* С. 50, вторая часть — карточка как в СУПРО 4: флажки меток, значки статусов, подзадачи под родителем */
.page-board .task-card { position: relative; }
.card-flags { position: absolute; top: 0; right: 8px; display: flex; gap: 2px; z-index: 2; }
.card-flag { display: block; color: var(--lb); line-height: 0; cursor: help; }
.card-flag .icon { width: 14px; height: 20px; filter: drop-shadow(0 1px 0 rgba(0,0,0,.15)); }
.page-board .card-icons { padding-right: 12px; gap: 3px 7px; }
.card-icons .card-num { margin-left: 0; order: 0; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-icons .ci { color: var(--text); }
.card-icons .ci .icon { width: 16px; height: 16px; }
/* с. 73: цвета значков статусов — точно по справочнику СУПРО 4 (kku_blocks_planner_task_statuses, значки от разработчиков v4) */
.ci-st-1, .ci-st-2 { color: #ffa500 !important; }
.ci-st-3 { color: #008000 !important; }
.ci-st-3 .icon { stroke-width: 2.6; }
.ci-st-4 { color: #3cb371 !important; }
.ci-st-5 { color: #808080 !important; }
.ci-info, .ci-period { color: #2f6fe0 !important; }
.ci-info.is-pending { font-weight: 700; color: #c26a00 !important; }
.page-board .task-due { background: none; padding: 0; color: #12a58a; font-weight: 600; }
.page-board .task-due.is-overdue { background: #fde4e4; color: #b3121d; padding: 2px 10px; }
.page-board .task-due.is-closed { background: none; color: var(--muted); }
.card-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: relative; z-index: 2; }
.card-actions .card-subtask { position: static; }
.card-nest { width: 26px; height: 22px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 4px; background: none; color: var(--muted); cursor: grab; touch-action: none; }
.card-nest .icon { width: 16px; height: 16px; }
.card-nest:hover { color: var(--brand); background: var(--surface-2); }
.card-subs { position: relative; z-index: 2; margin: 6px 0 0 10px; border-left: 2px solid color-mix(in srgb, var(--brand) 35%, var(--border)); }
.page-board .task-card.is-sub { padding: 6px 8px 6px 10px; border-bottom: 1px dashed var(--border); background: transparent !important; }
.page-board .task-card.is-sub:last-child { border-bottom: 0; }
.page-board .task-card.is-sub .card-title-row .task-title { font-size: 13px; -webkit-line-clamp: 3; }
.board-lines.hide-subs .card-subs { display: none; }
.task-card.is-drop-target { outline: 2px dashed var(--brand); outline-offset: -2px; background: color-mix(in srgb, var(--brand) 10%, var(--surface)) !important; }
.line-cards.is-drop-target { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.nest-ghost { position: fixed; z-index: 200; pointer-events: none; padding: 6px 10px; border-radius: 6px; background: var(--brand); color: var(--brand-text); font-size: 13px; box-shadow: var(--shadow); max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-person[draggable="true"] { cursor: grab; }
.assign-menu { position: fixed; z-index: 120; width: 220px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.assign-menu[hidden] { display: none; }
.board-tool-link { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 4px !important; border: 0; background: none; color: var(--brand) !important; font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.board-tool-link .icon { width: 16px; height: 16px; }
.board-estimate { width: min(1100px, 96vw); }
.estimate-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; padding-right: 40px; }
.estimate-head h2 { flex: 1; margin: 0; font-size: 18px; }
.estimate-table td.num, .estimate-table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.estimate-table tfoot th { color: var(--text); font-size: 14px; border-top: 2px solid var(--border); }

/* С. 50, третья часть (замечания Романа 26.10) */
/* ширина: на доске содержимое на всю ширину и при свёрнутом меню (правило html.sidebar-mini .content-inner ограничивало 1400 px) */
:root .page-board .content-inner { max-width: none; margin: 0; }
/* линии делят ширину экрана поровну (не уже 250 px); если линий много — прокрутка вбок */
@media (min-width: 701px) {
    .page-board .board-line { flex: 1 0 250px; max-width: 460px; }
    .page-board .board-line-new { flex: 0 0 200px; }
}
/* «В работе» — красная батарейка, как в СУПРО 4 */
.ci-st-2 { color: #ff0000 !important; }
/* аватары людей доски крупнее, с местом под рамку награды */
.board-people { gap: 6px 16px; padding: 6px 8px; }
.board-person { padding: 0; }
.board-person .avatar-framed { margin: 9px; }
/* подзадачи — во всю ширину карточки родителя */
.card-subs { margin: 6px -12px 0 6px; }
.page-board .task-card.is-sub { padding-right: 12px; }
.card-actions-right { display: inline-flex; align-items: center; gap: 2px; }
.card-delete { border: 0; background: none; color: var(--danger, #d33); font: inherit; font-size: 13px; cursor: pointer; padding: 2px 4px; position: relative; z-index: 2; }
.card-delete:hover { text-decoration: underline; }
/* завершённая и архивная доски — своя цветовая гамма (3.2.4.2 v4) */
.board-is-completed .page-board .line-head, .page-board.board-is-completed .line-head { background: #d9d9de; }
.page-board.board-is-completed .board-line { background: #f2f2f4; }
.page-board.board-is-completed .task-card { background: #f7f7f8 !important; }
.page-board.board-is-archived .line-head { background: #4a4a4a; color: #eee; }
.page-board.board-is-archived .line-head .line-menu > summary, .page-board.board-is-archived .line-head .line-sort > summary { color: #ddd; }
.page-board.board-is-archived .board-line { background: #eceef0; }
.page-board.board-is-archived .task-card { background: #f4f4f5 !important; color: #555; }
:root[data-theme="dark"] .page-board.board-is-completed .line-head { background: #3a3a3e; }
:root[data-theme="dark"] .page-board.board-is-completed .board-line, :root[data-theme="dark"] .page-board.board-is-archived .board-line { background: #222; }
:root[data-theme="dark"] .page-board.board-is-completed .task-card, :root[data-theme="dark"] .page-board.board-is-archived .task-card { background: #262626 !important; }
.board-copy { width: min(520px, 94vw); }
.board-copy h2 { margin: 0 40px 12px 0; font-size: 18px; }
.board-copy .stack { display: flex; flex-direction: column; gap: 10px; }
.board-copy .field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.board-copy .field input, .board-copy .field select { height: 36px; padding: 0 10px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }

/* С. 50, четвёртая часть (замечания Романа 26.10, после выкладки третьей части) */
/* доска ровно по высоте окна: каркас не тянется на 100vh (иначе внизу лишнее поле и полоса прокрутки страницы);
   высоту плашки тестовой площадки и подвала JS измеряет и пишет в --banner-h / --footer-h */
.page-board .shell { min-height: 0; }
@media (min-width: 861px) { .page-board .sidebar { height: calc(100vh - var(--topbar-h) - var(--footer-h) - var(--banner-h, 0px)); } }
/* карточка: курсор не меняется, текст не выделяется и не подчёркивается; тащить — удержанием 0,5 с */
.page-board .task-card { align-items: stretch; cursor: default; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.page-board .task-card[data-draggable], .page-board .task-card .task-link { cursor: default; }
.page-board .task-card a.task-link:hover { text-decoration: none; }
.page-board .task-card.is-lifted { position: relative; z-index: 5; background: var(--surface) !important; box-shadow: 0 6px 20px rgba(0,0,0,.22); transform: scale(1.015); transition: transform .12s, box-shadow .12s; cursor: grabbing; }
/* подзадачи — во всю ширину родителя (карточка — колонка, раньше align-items: flex-start сжимал их по тексту) */
.page-board .card-subs, .page-board .task-body { align-self: stretch; }
/* полосы прокрутки доски — графитовые */
.page-board .board-lines, .page-board .line-cards { scrollbar-color: #3a3a3a transparent; }
.page-board .board-lines::-webkit-scrollbar-thumb, .page-board .line-cards::-webkit-scrollbar-thumb { background: #3a3a3a; }
:root[data-theme="dark"] .page-board .board-lines, :root[data-theme="dark"] .page-board .line-cards { scrollbar-color: #8a8a8a transparent; }
:root[data-theme="dark"] .page-board .board-lines::-webkit-scrollbar-thumb, :root[data-theme="dark"] .page-board .line-cards::-webkit-scrollbar-thumb { background: #8a8a8a; }
/* поле навигации ниже: меньше отступы сверху и снизу */
.page-board .board-nav { padding: 2px 14px; margin-bottom: 10px; gap: 6px 18px; }
.page-board .board-nav-info { gap: 0; }
/* люди доски: плотно, видно 10, остальные — листанием ‹ › */
.board-people-wrap { display: flex; align-items: center; gap: 2px; min-width: 0; }
.board-people-wrap .board-people { display: flex; flex-wrap: nowrap; gap: 0; padding: 0; max-width: calc(10 * 52px + 8px); padding: 0 4px; overflow: hidden; scroll-behavior: smooth; }
.board-people-wrap .board-person { flex: 0 0 52px; height: 58px; display: grid; place-items: center; border: 0; border-radius: 0; }
.board-people-wrap .board-person .avatar-framed { margin: 0; }
.board-people-wrap .board-person[aria-pressed="true"] { box-shadow: none; }
.board-people-wrap .board-person[aria-pressed="true"] .avatar { outline: 2px solid var(--brand); outline-offset: 1px; box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand) 25%, transparent); }
.pc-arrow { flex: none; width: 26px; height: 40px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--brand); font-size: 26px; line-height: 1; cursor: pointer; }
.pc-arrow:hover:not(:disabled) { background: var(--surface-2); }
.pc-arrow:disabled { color: var(--border); cursor: default; }
@media (max-width: 700px) { .board-people-wrap { display: none; } .page-board .board-nav { padding: 6px 10px; } }

/* С. 50, пятая часть: название метки всплывает сразу при наведении (у title — задержка браузера) */
.card-flag { position: relative; cursor: default; }
.card-flag[data-tip]::after { content: attr(data-tip); position: absolute; top: 100%; right: -4px; margin-top: 3px; z-index: 30;
    padding: 3px 8px; border-radius: 5px; background: #2b2b2b; color: #fff; font-size: 12px; line-height: 1.35; white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,.2); pointer-events: none; opacity: 0; visibility: hidden; }
.card-flag[data-tip]:hover::after { opacity: 1; visibility: visible; }
.card-flag[data-tip=""]::after { display: none; }
/* ползунки линий и доски: стандартное — приглушённый сиреневый в тон фирменного цвета, светлое — нейтральный серый,
   графитовое — светло-серый; при наведении чуть темнее (замечание Романа 26.10: графитовые — чужеродные и тёмные) */
.page-board { --sb: color-mix(in srgb, var(--brand) 28%, #cfd0dc); --sb-hover: color-mix(in srgb, var(--brand) 55%, #cfd0dc); }
:root[data-theme="light"] .page-board { --sb: #c9ccd2; --sb-hover: #a3a8b0; }
:root[data-theme="dark"] .page-board { --sb: #5c5c5c; --sb-hover: #808080; }
.page-board .board-lines, .page-board .line-cards,
:root[data-theme="dark"] .page-board .board-lines, :root[data-theme="dark"] .page-board .line-cards { scrollbar-color: var(--sb) transparent; }
.page-board .board-lines::-webkit-scrollbar-thumb, .page-board .line-cards::-webkit-scrollbar-thumb,
:root[data-theme="dark"] .page-board .board-lines::-webkit-scrollbar-thumb, :root[data-theme="dark"] .page-board .line-cards::-webkit-scrollbar-thumb { background: var(--sb); }
.page-board .board-lines::-webkit-scrollbar-thumb:hover, .page-board .line-cards::-webkit-scrollbar-thumb:hover { background: var(--sb-hover); }
.page-board .task-card .task-link:focus:not(:focus-visible) { outline: none; }
/* поле навигации в одну строку и на 1366–1600 px: люди-карусель сжимается (листается стрелками), а не переносится вниз */
@media (min-width: 701px) {
    .page-board .board-nav { flex-wrap: nowrap; }
    .page-board .board-nav-info { flex: 1 1 auto; min-width: 220px; }
    .page-board .board-people-wrap { flex: 0 1 auto; min-width: 140px; }
    .page-board .board-people-wrap .board-people { flex: 0 1 auto; min-width: 0; }
    .page-board .board-nav-tools { flex: none; }
}
/* «Добавить подзадачу» в узкой подзадаче — в одну строку */
.page-board .card-subtask { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* кнопка «Сохранить» в форме метки внутри меню «Инструменты» выглядела как простой текст */
.dropdown .label-form .btn-primary { width: auto; display: inline-flex; justify-content: center; padding: 6px 16px; background: var(--brand); color: var(--brand-text, #fff); border-radius: var(--radius-sm); }
.dropdown .label-form .btn-primary:hover { background: color-mix(in srgb, var(--brand) 85%, #000); }
/* меню линии и сортировки — во всю ширину линии под шапкой (линия обрезает выступающее за край: overflow hidden) */
.page-board .line-head { position: relative; }
.page-board .line-head .line-menu, .page-board .line-head .line-sort { position: static; }
.page-board .line-head .line-menu-body { left: 6px; right: 6px; top: calc(100% - 4px); width: auto; }
/* название команды/проекта/доски в одну строку; длинное — с многоточием (полностью — в подсказке) */
@media (min-width: 701px) {
    .page-board .board-nav-info { flex: 0 0 auto; max-width: 48%; }
    .page-board .board-nav-row { flex-wrap: nowrap; white-space: nowrap; }
    .page-board .board-nav-row > a, .page-board .board-nav-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    .page-board .board-people-wrap { flex: 1 1 auto; justify-content: flex-end; }
}

/* ——— Окно задачи как в СУПРО 4 (сессия 51, 3.2.5 / 3.2.6 v4): слева задача, справа «Меню инструментов задачи» ——— */
.modal-task:has(.tp) { width: min(1220px, calc(100vw - 24px)); max-height: none; padding: 0; background: transparent; border: 0; box-shadow: none; overflow: visible; }
.modal-task:has(.tp) > .modal-close { display: none; }
.task-sheet:has(.tp) { max-width: 1220px; padding: 0; background: transparent; border: 0; box-shadow: none; }
.task-sheet .tp-x, .task-sheet .tm-x { visibility: hidden; }
.tp { position: relative; display: flex; gap: 16px; align-items: flex-start; }
.tp-main { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 26px 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, .22); }
.modal-task .tp-main, .modal-task .tp-menu { max-height: calc(100vh - 48px); overflow-y: auto; scrollbar-width: thin; }
.tp-menu { flex: 0 0 300px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, .22); position: sticky; top: 0; }
.tp-head { display: grid; grid-template-columns: 36px 1fr 36px; align-items: center; }
.tp-title { margin: 0; text-align: center; font-size: 20px; font-weight: 600; color: var(--brand); }
.tp-burger { visibility: hidden; }
.tp-where { text-align: center; margin: 0 0 8px; }
.tp-note { margin: 0 0 8px; padding: 6px 10px; background: var(--surface-2); border-radius: var(--radius-sm); }
/* статусы — ряд кнопок; неактивные — бледные */
.tp-statuses { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 6px 0 2px; }
.st-btn { position: relative; display: inline-flex; align-items: center; border: 0; border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; line-height: 1.2; cursor: pointer; opacity: .42; text-decoration: none; }
.st-btn input { position: absolute; opacity: 0; pointer-events: none; }
.st-btn.is-on, .st-btn:has(input:checked) { opacity: 1; font-weight: 600; box-shadow: inset 0 0 0 1.5px currentColor; }
.st-btn[data-status-set]:hover, label.st-btn:hover { opacity: .8; }
.st-btn:disabled { cursor: default; }
.st-btn.st-new { background: #fff4c7; color: #a87400; border: 0; }
.st-btn.st-work { background: #fde3e3; color: #d64545; }
.st-btn.st-done { background: #dcf5eb; color: #23996b; }
.st-btn.st-checked { background: #e1efff; color: #3d8bd9; }
.st-btn.st-cancel { background: #efefef; color: #8a8a8a; text-decoration: none; }
.tp-status-at { text-align: center; margin: 2px 0 0; }
/* люди, сроки, сложность, метки */
.tp-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 4px 28px; margin: 14px 0 12px; }
.tp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 32px; margin-bottom: 2px; }
.tp-lbl { font-weight: 600; min-width: 74px; text-align: right; }
.tp-col + .tp-col .tp-lbl { min-width: 0; text-align: left; }
.tp-val { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tp-val.is-overdue { color: var(--danger); font-weight: 600; }
.tp-person { color: var(--brand); text-decoration: none; }
.tp-person:hover { text-decoration: underline; }
.tp-row > .error { flex-basis: 100%; }
.tp-dates input[type=date], .tp-dates input[type=time], .tp-cx, .tp-unit { height: 32px; padding: 0 6px; font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.tp-dates input[type=time] { width: 96px; }
.tp-cx { width: auto; min-width: 64px; }
.tp-unit { max-width: 100%; border-style: dashed; color: var(--muted); }
.tp-periodic { font-size: 14px; }
.tp-periodic b { font-weight: 600; }
.tp-prio { margin-top: 6px; font-size: 14px; }
.prio-pill { display: inline-flex; padding: 2px 10px; border-radius: 999px; background: #fde3e3; color: #d64545; font-size: 13px; font-weight: 600; }
.tp-labels .labels { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.label-add { list-style: none; cursor: pointer; font-weight: 700; font-size: 18px; line-height: 1; color: var(--brand); padding: 0 4px; border: 0 !important; }
.label-add::-webkit-details-marker { display: none; }
.label-pick-check { display: flex; align-items: center; gap: 6px; padding: 2px 0; cursor: pointer; }
/* выбор человека: аватар, ФИО полностью, нагрузка */
.pp { position: relative; display: inline-block; }
.pp-sum { list-style: none; display: inline-flex; align-items: center; cursor: pointer; color: var(--muted); padding: 3px; border-radius: 6px; }
.pp-sum::-webkit-details-marker { display: none; }
.pp-sum:hover { color: var(--brand); background: var(--surface-2); }
.pp-sum > .icon { width: 16px; height: 16px; }
.pp-add { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.pp-add .icon { width: 18px; height: 18px; }
.pp-pop { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; width: 340px; max-height: 360px; overflow-y: auto; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.pp-q { width: 100%; height: 32px; margin-bottom: 6px; padding: 0 8px; font: inherit; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.pp-list { list-style: none; margin: 0; padding: 0; }
.pp-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 8px; border: 0; background: none; font: inherit; font-size: 14px; text-align: left; color: var(--text); cursor: pointer; border-radius: 6px; }
.pp-item:hover { background: var(--surface-2); }
.pp-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pp-load { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pp-empty { padding: 6px 8px; }
.pp-new { display: flex; align-items: center; gap: 6px; margin-top: 4px; padding: 8px; border-top: 1px solid var(--border); text-decoration: none; }
.pp-new .icon { width: 18px; height: 18px; }
.tp-menu .pp { display: block; }
.tp-menu .pp-pop { position: static; width: auto; max-height: 320px; margin: 2px 0 8px 28px; box-shadow: none; }
/* название, описание, блоки */
.tp .task-title-input { text-align: center; font-size: 20px; margin: 4px 0 8px; }
.tp .task-title-view { text-align: center; margin: 4px 0 10px; }
.tp-desc > label { font-weight: 700 !important; color: var(--text) !important; font-size: 15px !important; }
.tp-finance { margin: 12px 0; }
.tp-periodical { margin: 6px 0 10px; }
.tp-create-foot { display: flex; justify-content: flex-end; margin-top: 14px; }
.tp .comments-head h3, .tp .files-head h3, .tp .checklist-head h3, .tp .acq-head h3 { font-size: 15px; }
.tp .comment-actions .btn .icon { width: 16px; height: 16px; }
.task-history > summary .icon { width: 16px; height: 16px; vertical-align: -3px; }
/* «Меню инструментов задачи» */
.tm-head { display: flex; align-items: center; justify-content: flex-end; min-height: 32px; }
.tm-head-title { display: none; flex: 1; font-weight: 700; }
.tm-x-mobile { display: none; }
.tm-h { margin: 10px 0 4px; font-size: 15px; font-weight: 700; }
.tm-head + .tm-h { margin-top: 0; }
.tm-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 5px 6px; border: 0; background: none; font: inherit; font-size: 14px; color: var(--text); text-align: left; text-decoration: none; cursor: pointer; border-radius: 6px; list-style: none; }
.tm-item::-webkit-details-marker { display: none; }
.tm-item > .icon { flex: none; width: 18px; height: 18px; color: var(--brand); }
.tm-item:hover, .tm-sub[open] > summary { background: var(--surface-2); }
.tm-item.danger, .tm-item.danger > .icon { color: var(--danger); }
.tm-sub > summary { list-style: none; }
.tm-sub > summary::-webkit-details-marker { display: none; }
.tm-form { display: flex; flex-direction: column; gap: 6px; padding: 6px 4px 10px 34px; }
.tm-form select, .tm-form input:not([type=checkbox]) { width: 100%; height: 34px; padding: 0 8px; font: inherit; font-size: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.tm-form .doc-pick-list button { display: flex; flex-direction: column; align-items: flex-start; }
.tm-type label { position: relative; }
.tm-type input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.tm-type label:has(input:checked) { font-weight: 600; }
.tm-type label .when-on { display: none; }
.tm-type label:has(input:checked) .when-on { display: inline; }
.tm-type label:has(input:checked) .when-off { display: none; }
.tm-save { color: var(--brand); font-weight: 600; }
/* «Сохранить задачу?», «Копирование/перемещение задачи» */
.tp-confirm { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .4); }
.tp-confirm[hidden] { display: none; }
.tp-confirm-box { width: min(480px, 100%); padding: 20px 24px; background: var(--surface); color: var(--text); border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0, 0, 0, .3); }
.tp-confirm-box h3 { margin: 0 0 6px; font-size: 17px; }
.tp-confirm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }
.tp-shade { display: none; }
@media (max-width: 860px) {
    .modal-task:has(.tp) { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; }
    .tp { display: block; }
    .modal-task .tp-main { min-height: 100dvh; max-height: 100dvh; border-radius: 0; padding: 8px 14px 80px; }
    .task-sheet .tp-main { padding: 10px 14px; }
    .tp-burger { visibility: visible; }
    .tp-grid { grid-template-columns: 1fr; }
    .tp-lbl { min-width: 0; text-align: left; }
    .tp-periodic { margin-left: 0; }
    .tp-menu { position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(86vw, 340px); max-height: none !important; border-radius: 0; transform: translateX(105%); transition: transform .2s ease; }
    .tp.menu-open .tp-menu { transform: none; }
    .tp.menu-open .tp-shade { display: block; position: fixed; inset: 0; z-index: 49; background: rgba(0, 0, 0, .35); }
    .tm-head-title { display: block; }
    .tm-x-mobile { display: inline-flex; }
    .tm-x { display: none; }
    .pp-pop { width: min(320px, 86vw); }
    .tp-create-foot { position: sticky; bottom: 0; padding: 8px 0; background: var(--surface); }
    .tp .task-title-input { font-size: 18px; }
}
:root[data-theme="dark"] .st-btn.st-new { background: #4a3d10; color: #ffd76a; }
:root[data-theme="dark"] .st-btn.st-work { background: #4a1f1f; color: #ff8d8d; }
:root[data-theme="dark"] .st-btn.st-done { background: #183d2f; color: #6fdcae; }
:root[data-theme="dark"] .st-btn.st-checked { background: #1b3350; color: #8cc1ff; }
:root[data-theme="dark"] .st-btn.st-cancel { background: #2c2c2c; color: #9e9e9e; }
/* левая колонка — подписи справа по ширине, значения рядом (как в v4) */
.tp-col:first-child .tp-row { display: grid; grid-template-columns: 118px minmax(0, 1fr); column-gap: 10px; }
.tp-col:first-child .tp-row > .error { grid-column: 2; }
.tp-row-sub { min-height: 0; margin-top: -2px; }
.tp-row-sub .overdue-flag[hidden] { display: none; }
.tp-col:first-child .tp-row-sub:has(.overdue-flag[hidden]) { display: none; }
.tp-periodic { margin: 0; }
.tm-delegate .pp-sum { display: block; padding: 0; }
.tm-delegate .pp-sum:hover { background: none; }
@media (max-width: 860px) { .tp-col:first-child .tp-row { grid-template-columns: 96px minmax(0, 1fr); } }
.tp-grid { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
.tp-col:first-child .tp-row { align-items: start; }
.tp-col:first-child .tp-lbl { padding-top: 5px; }
.tp-dates input[type=date] { width: 140px; }
.tc-checklist { margin-bottom: 10px; }
.tc-checklist input, .tc-checklist textarea { width: 100%; padding: 6px 8px; font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.tc-checklist .checklist-head { gap: 6px; margin-bottom: 6px; }
.tc-checklist .checklist-head input { flex: 1; font-weight: 600; }
@media (max-width: 860px) {
    .tp-grid { grid-template-columns: 1fr; gap: 0; }
    .tp-col:first-child .tp-row { grid-template-columns: 92px minmax(0, 1fr); column-gap: 8px; }
    .tp-col + .tp-col { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
    .tp-dates input[type=date] { width: 132px; }
    .tp-lbl { font-size: 14px; }
    .tp-unit { width: 100%; }
}
@media (max-width: 860px) {
    .tp-col:first-child .tp-row { grid-template-columns: 104px minmax(0, 1fr); }
    .tp-col:first-child .tp-lbl { font-size: 13px; overflow-wrap: anywhere; }
    .tp-dates .inline-fields { flex-wrap: wrap; }
}
/* ——— Окно задачи, вторая часть сессии 51: отступы, переходы, люди, метки, файлы, финансы, исполнение ——— */
.tp-main { padding: 16px 40px 20px; }
.tp-nav { position: sticky; top: -16px; z-index: 6; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 4px -40px 8px; padding: 8px 40px; background: var(--surface); border-bottom: 1px solid var(--border); }
.tp-nav[hidden] { display: none; }
.tp-nav-btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 3px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.tp-nav-btn:hover { border-color: var(--brand); color: var(--brand); }
[data-tp-section] { scroll-margin-top: 56px; }
/* люди — одинаковые карточки: аватар + ФИО (ссылка на профиль), × или карандаш */
.tp-chip { padding: 2px 6px 2px 3px; gap: 2px; }
.tp-chip .pc-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text); text-decoration: none; }
.tp-chip .pc-link:hover { color: var(--brand); text-decoration: underline; }
.tp-chip .pp-sum { padding: 2px; }
.tp-chip .pp-sum > .icon { width: 14px; height: 14px; }
.tp-val > .tp-chip { max-width: 100%; }
.pp-units .pp-add .icon { width: 18px; height: 18px; }
.pp-units .pp-pop { width: 360px; }
.tc-unit-chip[hidden] { display: none; }
.tp-hours { width: 110px; height: 32px; padding: 0 8px; font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
/* окно «Метки» как в v4 — раскрывается влево от «+», не уезжает за край */
.tp .label-menu-body.lm { left: auto; right: 0; top: 28px; width: 300px; max-width: calc(100vw - 40px); padding: 10px 12px 12px; gap: 8px; }
.tp-labels .label-menu { position: relative; }
.lm-head { font-weight: 700; text-align: center; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.lm-q { height: 32px; padding: 0 8px; font: inherit; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.lm-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.lm-row { display: grid; grid-template-columns: minmax(0, 1fr) 30px; gap: 4px; align-items: center; }
.lm-row[hidden] { display: none; }
.lm-bar { min-height: 32px; padding: 0 10px; border: 0; border-radius: 4px; background: var(--lb); color: var(--lf); font: inherit; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.lm-bar:hover { filter: brightness(.95); }
.lm-bar.is-on { box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .35); }
.lm-edit { width: 30px; height: 30px; border: 0; background: none; color: var(--muted); border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.lm-edit:hover { background: var(--surface-2); color: var(--brand); }
.lm-edit .icon { width: 16px; height: 16px; }
.lm-form { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; padding: 8px; background: var(--surface-2); border-radius: var(--radius-sm); }
.lm-form[hidden] { display: none; }
.lm-form input[name=title] { height: 32px; padding: 0 8px; font: inherit; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.lm-form-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.lm-new-btn { justify-content: center; }
.lm-new-btn[hidden] { display: none; }
/* описание — редактор как у объявлений */
.tp-desc .rte-task .rte-area { min-height: 120px; max-height: none; }
.tp-desc .rte-task .rte-bar { top: 30px; }
.tp-desc .task-desc { padding: 2px 0; }
.tp-desc .task-desc img, .tp-desc .rte-area img { max-width: 100%; height: auto; }
/* файлы — сразу под описанием: карусель или перечень */
.tp-files { margin: 10px 0 14px; }
.files-view { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.files-view button { width: 30px; height: 28px; border: 0; background: var(--surface); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.files-view button + button { border-left: 1px solid var(--border); }
.files-view button[aria-pressed=true] { background: var(--brand-soft); color: var(--brand); }
.files-view .icon { width: 16px; height: 16px; }
.tp-files .fc, .tp-files .fl-table { display: none; }
.tp-files[data-view=carousel] .fc { display: flex; }
.tp-files[data-view=list] .fl-table { display: table; }
.fc { align-items: center; gap: 6px; }
.fc-track { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; padding: 2px 2px 6px; flex: 1; min-width: 0; }
.fc-tile { position: relative; flex: 0 0 150px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 4px; }
.fc-thumb { display: flex; align-items: center; justify-content: center; height: 110px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); overflow: hidden; text-decoration: none; }
.fc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fc-thumb .file-ext { font-size: 18px; }
.fc-name { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-x { position: absolute; top: 4px; right: 4px; background: var(--surface); border-radius: 50%; width: 22px; height: 22px; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.fc-nav { flex: none; width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; }
.fc-nav:hover { color: var(--brand); border-color: var(--brand); }
.fl-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fl-table td { padding: 6px 6px; border-top: 1px solid var(--border); vertical-align: middle; }
.fl-table tr:first-child td { border-top: 0; }
.fl-ext { width: 52px; }
.fl-name { overflow-wrap: anywhere; }
.fl-name a { color: var(--text); text-decoration: none; font-weight: 500; }
.fl-name a:hover { color: var(--brand); text-decoration: underline; }
.fl-act { width: 80px; text-align: right; white-space: nowrap; }
/* финансирование — две строки (Расходы, Доходы) × План / Взято обязательств / Факт */
.tp-cur { height: 30px; padding: 0 6px; font: inherit; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.fin-table { width: 100%; border-collapse: separate; border-spacing: 8px 6px; margin: 0 -8px; font-size: 14px; table-layout: fixed; }
.fin-table thead th { font-weight: 600; font-size: 13px; color: var(--muted); text-align: left; }
.fin-table thead th:first-child, .fin-table tbody th { width: 84px; }
.fin-table tbody th { text-align: left; font-weight: 600; }
.fin-table input { width: 100%; height: 34px; padding: 0 8px; font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.fin-table input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); outline: none; }
.fin-table input.is-flash { animation: fin-flash 1.6s ease; }
@keyframes fin-flash { 0%, 60% { box-shadow: 0 0 0 4px var(--brand-soft); background: var(--brand-soft); } 100% { background: var(--surface); } }
/* «Исполнение» — отдельный блок с бо́льшими отступами; каждое сообщение — карточка (как в v4) */
.tp-exec { margin: 18px -16px 14px; padding: 16px 32px 18px; background: var(--surface-2); border-radius: var(--radius); }
.tp-exec .comment-list { gap: 10px; }
.tc-card { display: block; padding: 10px 14px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }
.tc-head { display: flex; align-items: center; gap: 10px; }
.tc-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tc-name { font-weight: 600; color: var(--text); text-decoration: none; }
.tc-name:hover { color: var(--brand); text-decoration: underline; }
.tc-tools { display: inline-flex; gap: 2px; }
.tc-tools .btn .icon { width: 16px; height: 16px; }
.tc-card .comment-text { margin: 8px 0 0; padding: 0; background: none; font-size: 14px; }
.tc-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tp-exec .comment-new textarea { background: var(--surface); }
@media (max-width: 860px) {
    .tp-main, .modal-task .tp-main { padding-left: 16px; padding-right: 16px; }
    .tp-nav { margin: 4px -16px 8px; padding: 6px 16px; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; justify-content: flex-start; top: -8px; }
    .tp-nav-btn { flex: none; }
    .tp-exec { margin: 14px -8px; padding: 12px 12px 14px; }
    .tc-card { padding: 10px 10px 12px; }
    .fin-table { border-spacing: 4px 6px; margin: 0 -4px; font-size: 13px; }
    .fin-table thead th { font-size: 11px; }
    .fin-table thead th:first-child, .fin-table tbody th { width: 64px; }
    .fin-table input { padding: 0 4px; font-size: 13px; }
    .fc-tile { flex-basis: 120px; }
    .fc-thumb { height: 90px; }
    .fc-nav { display: none; }
    .tp .label-menu-body.lm { position: fixed; left: 12px; right: 12px; top: 80px; width: auto; max-width: none; }
}
.tp-col + .tp-col .tp-row:has(.tp-hours) .tp-lbl { white-space: nowrap; }
.tp-hours { width: 76px; flex: none; }
@media (max-width: 860px) {
    .tp-col:first-child .tp-row { grid-template-columns: 112px minmax(0, 1fr); }
    .tp-col:first-child .tp-lbl { overflow-wrap: normal; white-space: nowrap; }
}
/* Смета (с. 51): общие итоги сверху, линии с «Итого по линии», расходы и доходы — план / обязательства / факт */
.board-estimate { width: min(1240px, 97vw); }
.est-summary { margin-bottom: 16px; }
.estimate-table th.est-group { text-align: center; border-bottom: 1px solid var(--border); }
.estimate-table .est-gap { border-left: 2px solid var(--border); }
.est-totals .est-total th, .est-totals .est-total td { font-weight: 700; background: var(--brand-soft); }
.est-totals tbody td:first-child { padding-left: 22px; }
.est-line-head th { text-align: left; font-size: 14px; color: var(--text); background: var(--surface-2); padding-top: 10px; }
.est-subtotal th, .est-subtotal td { font-weight: 600; border-top: 1px solid var(--border); }
.est-subtotal th { text-align: right; }
.est-main tfoot th, .est-main tfoot td { font-weight: 700; color: var(--text); border-top: 2px solid var(--border); }
.est-main tfoot th:nth-child(2) { text-align: right; }
.est-line[hidden] { display: none; }
/* С. 51: значки карточки — всплывающее окно со значениями, как у метки (сразу при наведении). Окно рисует JS в <body>
   (.ftip, position: fixed) — внутри линии его обрезала бы прокрутка линии. */
.card-icons .ci[data-tip], .card-icons .card-num[data-tip] { pointer-events: auto; cursor: default; }
.ftip { position: fixed; z-index: 90; max-width: 300px; padding: 6px 10px; border-radius: 5px; background: #2b2b2b; color: #fff;
    font-size: 12px; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; box-shadow: 0 4px 14px rgba(0,0,0,.25); pointer-events: none; }
.ftip[hidden] { display: none; }
body:has(#task-modal[open]) > .helper, body:has(#task-modal[open]) .helper[data-helper] { visibility: hidden; }
/* Смета (с. 51): общие итоги сверху, линии с «Итого по линии», расходы и доходы — план / обязательства / факт */
.board-estimate { width: min(1240px, 97vw); }
.est-summary { margin-bottom: 16px; }
.estimate-table th.est-group { text-align: center; border-bottom: 1px solid var(--border); }
.estimate-table .est-gap { border-left: 2px solid var(--border); }
.est-totals .est-total th, .est-totals .est-total td { font-weight: 700; background: var(--brand-soft); }
.est-totals tbody td:first-child { padding-left: 22px; }
.est-line-head th { text-align: left; font-size: 14px; color: var(--text); background: var(--surface-2); padding-top: 10px; }
.est-subtotal th, .est-subtotal td { font-weight: 600; border-top: 1px solid var(--border); }
.est-subtotal th { text-align: right; }
.est-main tfoot th, .est-main tfoot td { font-weight: 700; color: var(--text); border-top: 2px solid var(--border); }
.est-main tfoot th:nth-child(2) { text-align: right; }
.est-line[hidden] { display: none; }
/* С. 51: значки карточки — всплывающее окно со значениями, как у метки (сразу при наведении; строки — переводами строк) */
.card-icons .ci[data-tip], .card-icons .card-num[data-tip] { position: relative; pointer-events: auto; cursor: default; }
.card-icons [data-tip]::after { content: attr(data-tip); position: absolute; top: 100%; left: -6px; margin-top: 4px; z-index: 40;
    width: max-content; max-width: 280px; padding: 5px 9px; border-radius: 5px; background: #2b2b2b; color: #fff;
    font-size: 12px; font-weight: 400; line-height: 1.4; white-space: pre-line; overflow-wrap: anywhere; text-align: left;
    box-shadow: 0 2px 8px rgba(0,0,0,.2); pointer-events: none; opacity: 0; visibility: hidden; }
.card-icons [data-tip]:hover::after { opacity: 1; visibility: visible; }
.task-card:has(.card-icons [data-tip]:hover) { z-index: 30; }
.board-line:has(.card-icons [data-tip]:hover) { z-index: 5; }
/* Канбанчик в окне задачи (с. 51): внутри <dialog>, в правом нижнем углу окна */
.th { position: fixed; right: 18px; bottom: 18px; z-index: 55; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.th > * { pointer-events: auto; }
.th .th-btn { width: 56px; height: 56px; }
.th-bubble { position: relative; max-width: 320px; background: var(--surface); color: var(--text); border: 2px solid var(--brand); border-radius: 14px; padding: 10px 30px 10px 14px; font-size: 14px; line-height: 1.4; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); cursor: pointer; animation: helper-pop .25s ease-out; }
.th-bubble p { margin: 0 0 4px; }
.th-bubble p:last-of-type { margin-bottom: 0; }
.th-bubble p:first-of-type { font-weight: 600; }
.th-bubble::after { content: ""; position: absolute; right: 22px; bottom: -9px; width: 14px; height: 14px; background: var(--surface); border-right: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(45deg); }
.th-panel { width: 380px; max-height: min(640px, calc(100vh - 100px)); }
.th-panel .helper-body p { margin: 0 0 6px; font-size: 14px; }
.th-tips { margin: 10px 0 0; font-size: 14px; }
.th-tips dt { font-weight: 700; margin-top: 8px; }
.th-tips dt .link-btn { font-weight: 700; padding: 0; }
.th-tips dd { margin: 2px 0 0; color: var(--muted); }
.th-bubble[hidden], .th-panel[hidden], .th .th-btn[hidden], .th .th-show[hidden] { display: none; }
@media (max-width: 860px) {
    .th { right: 10px; bottom: 76px; }
    .th .th-btn { width: 48px; height: 48px; }
    .th-panel { width: calc(100vw - 20px); max-height: calc(100dvh - 150px); }
    .th-bubble { max-width: calc(100vw - 40px); }
}
.tc-head > .grow { display: none; }
.tc-who .tc-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 860px) { .tp-create-foot { justify-content: flex-start; } .tp-create .th { bottom: 90px; } }

/* ===== С. 52: «Оценка эффективности работы» (3.1.6 v4) и достижения в профиле ===== */
.rt-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 12px; }
.rt-period { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.rt-period label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.rt-period input[type="date"], .rt-period select { height: 34px; }
.rt-quarter select { min-width: 150px; }
.rt-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.rt-main { padding: 6px 10px; }
.rt-aside { position: sticky; top: 12px; padding: 14px 16px; }
.rt-aside h3 { margin: 0 0 8px; font-size: 16px; }
.rt-aside p { margin: 0 0 8px; }
.rating-table th.num, .rating-table td.num { text-align: right; }
.rating-table td { white-space: normal; vertical-align: middle; }
.rating-user { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.rating-user .avatar-framed { margin: 6px; }
.rating-who { display: flex; flex-direction: column; line-height: 1.25; }
.rating-fio { font-weight: 600; }
a.rating-user:hover .rating-fio { text-decoration: underline; }
.rt-sort { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: inherit; cursor: pointer; text-align: inherit; }
.rt-sort::after { content: ""; display: inline-block; width: 1em; opacity: .55; }
.rt-sort.is-asc::after { content: " ▲"; } .rt-sort.is-desc::after { content: " ▼"; }
.rt-score { display: inline-flex; align-items: center; gap: 6px; min-width: 52px; justify-content: flex-end; padding: 4px 8px; border: 1px solid transparent; border-radius: var(--radius-sm); background: none; font: inherit; color: var(--link); cursor: pointer; }
.rt-score:hover { border-color: var(--border); background: var(--surface-2); }
.rt-score.is-strong { font-weight: 700; }
.rt-score.is-active { border-color: var(--brand); background: var(--brand-soft); color: var(--text); }
.rt-calc { margin: 8px 0; font-size: 13px; }
.rt-calc td, .rt-calc th { padding: 5px 6px; }
.rt-calc tfoot td { border-top: 2px solid var(--border); }
.rt-calc-who { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.rt-calc-who .avatar-framed { margin: 4px; }
td.is-late { color: var(--danger, #c62828); }
@media (max-width: 1100px) { .rt-layout { grid-template-columns: 1fr; } .rt-aside { position: static; } }
@media (max-width: 640px) {
  .rt-period { width: 100%; } .rt-period .btn { width: 100%; justify-content: center; }
  .rating-table thead th:first-child { min-width: 170px; }
}
.award-list .is-worn { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.award-worn { color: var(--brand); font-weight: 600; margin-top: 4px; }
.award-list form { margin-top: 6px; }
.award-hint { margin: 0 0 10px; }
.award-auto { margin-top: 10px; }
.rating-table { width: 100%; }
.rating-table th { white-space: normal; vertical-align: bottom; line-height: 1.2; }
.rating-table th:first-child { min-width: 250px; }
.rating-table th.num { width: 112px; }
.rating-table td:first-child { min-width: 250px; }
.rating-who .muted { font-size: 12px; }
.rt-calc { width: 100%; table-layout: fixed; }
.rt-calc th, .rt-calc td { white-space: normal; }
.rt-calc th.num, .rt-calc td.num { width: 54px; text-align: right; }
.rt-calc th:first-child { width: auto; }
@media (max-width: 640px) { .rating-table th:first-child, .rating-table td:first-child { min-width: 180px; } .rating-table th.num { width: 84px; } }
.award-wear { height: 30px; padding: 0 12px; font-size: 13px; }
/* С. 52: кубок лучшего подразделения — в правом нижнем углу поверх аватара и рамки */
.avatar-cup { position: absolute; right: calc(var(--av) * -0.18); bottom: calc(var(--av) * -0.18); width: calc(var(--av) * .55); height: calc(var(--av) * .55); min-width: 14px; min-height: 14px; z-index: 2; pointer-events: none; max-width: none; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.award-list .is-cup img { width: 44px; height: 44px; padding: 2px; }
/* С. 52, правки Романа 27.10: команда по центру со стрелками (как v4), вкладки «Члены команды / Подразделения», кубки, окно задач */
.rt-bar { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 8px 12px; margin-bottom: 12px; }
.rt-bar select { min-width: 260px; max-width: 70vw; height: 38px; padding: 0 12px; font: inherit; font-weight: 700; font-size: 16px; text-align: center; color: var(--text); background: transparent; border: 0; border-radius: var(--radius-sm); cursor: pointer; }
.rt-bar select:hover { background: var(--surface-2); }
.rt-arrow { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: var(--brand-text, #fff); flex: none; }
.rt-arrow:hover { filter: brightness(1.08); }
.rt-arrow.is-off { opacity: .35; pointer-events: none; }
.rt-arrow .icon { width: 18px; height: 18px; }
.rt-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.rt-tab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; }
.rt-tab:hover { background: var(--surface-2); }
.rt-tab.is-active { background: var(--brand); color: var(--brand-text, #fff); }
.rt-tab .icon { width: 18px; height: 18px; }
.rt-period { border-radius: var(--radius); }
.rt-period input[type="date"], .rt-period select { padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
.rating-cup { width: 22px; height: 22px; vertical-align: -5px; }
.rt-score.is-static { cursor: default; color: var(--text); }
.rt-score.is-static:hover { border-color: transparent; background: none; }
.rt-unit { display: flex; align-items: center; gap: 10px; }
.rt-unit-heads { display: inline-flex; gap: 2px; min-width: 28px; }
.rt-modal { width: min(1100px, 96vw); max-height: 88vh; padding: 18px 20px; border: 0; border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.rt-modal::backdrop { background: rgba(20, 20, 30, .45); }
.rt-modal-close { position: absolute; top: 10px; right: 10px; }
.rtm-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0 40px 12px 0; }
.rtm-who { font-size: 17px; }
.rtm-table td { white-space: normal; }
@media (max-width: 640px) { .rt-bar select { min-width: 0; font-size: 15px; } .rt-tabs { width: 100%; } .rt-tab { flex: 1; justify-content: center; } .rt-modal { padding: 14px 12px; } }
.rating-table.rt-units th:first-child, .rating-table.rt-units td:first-child { min-width: 0; width: 36px; }
.rating-table.rt-units th:nth-child(2), .rating-table.rt-units td:nth-child(2) { min-width: 260px; }
@media (max-width: 640px) { .rating-table.rt-units th:nth-child(2), .rating-table.rt-units td:nth-child(2) { min-width: 170px; } }
@media (max-width: 1100px) { .rt-layout { grid-template-columns: minmax(0, 1fr); } .rt-layout > * { min-width: 0; } }

/* ——— С. 53: «Рабочий стол. Проекты» (3.2.2 v4) и «Паспорт проекта» (3.2.3 v4) ——— */
.btn-icon-plain { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; flex: none; }
.btn-icon-plain:hover { background: var(--surface-2); color: var(--text); }
.btn-icon-plain .icon { width: 18px; height: 18px; }
.desk-switch { margin-bottom: 10px; }
.desk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 8px; }
.desk-recent-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 4px 2px; border: 0; background: none; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; margin-right: auto; }
.desk-recent-toggle .icon { width: 16px; height: 16px; transform: rotate(-90deg); transition: transform .15s; }
.desk-recent-toggle[aria-expanded="false"] .icon { transform: rotate(90deg); }
.desk-search { width: 240px; max-width: 100%; height: 36px; padding: 0 14px; font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid color-mix(in srgb, var(--brand) 45%, var(--border)); border-radius: 10px; }
.desk-search:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.desk-tools-btn { color: var(--brand); font-weight: 600; }
:root[data-theme="dark"] .desk-tools-btn { color: var(--text); }
.desk-tools { right: 0; left: auto; min-width: 250px; padding: 8px; z-index: 30; }
.desk-check { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.desk-check:hover { background: var(--surface-2); }
.desk-check input { width: 16px; height: 16px; accent-color: var(--brand); }
.desk-recent { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.desk-recent[hidden] { display: none; }
.desk-recent-card { position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 96px; padding: 14px 16px 30px; background: var(--surface); border-radius: var(--radius); box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
.desk-recent-card:hover { box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 40%, transparent), 0 2px 8px rgba(0, 0, 0, .08); }
.desk-recent-title { font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.desk-recent-title::after { content: ''; position: absolute; inset: 0; }
.desk-recent-forget { position: absolute; right: 8px; bottom: 6px; margin: 0; z-index: 1; }
.desk-recent-empty { grid-column: 1 / -1; margin: 0; }
.desk-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 4px 0 6px; }
.desk-sort { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.desk-sort select { height: 36px; min-width: 200px; padding: 0 10px; font: inherit; font-weight: 400; color: var(--text); background: var(--surface); border: 1px solid color-mix(in srgb, var(--brand) 45%, var(--border)); border-radius: 10px; }
.desk-view { color: var(--brand); }
.desk-view .icon { width: 24px; height: 24px; }
.desk-nothing { margin: 16px 0; }
.desk-path { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 2px 0 8px; padding: 8px 14px; background: var(--surface); border-radius: var(--radius); border-left: 5px solid var(--pc); box-shadow: var(--shadow); font-size: 15px; }
.desk-path .sep { color: var(--muted); }
.desk-path strong { font-weight: 700; }

/* Папки проектов (как v4): обложка над цветной папкой с ярлыком состояния */
.pf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 22px 14px; align-items: end; }
.pf { position: relative; display: flex; flex-direction: column; min-width: 0; }
.pf[hidden], .desk-board[hidden] { display: none; }
.pf-cover { display: flex; align-items: center; justify-content: center; height: 110px; margin: 0 14px -18px; padding: 8px; border: 2px dashed color-mix(in srgb, var(--brand) 35%, transparent); border-bottom: 0; border-radius: 6px 6px 0 0; transform: rotate(-3deg); transform-origin: bottom center; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.pf-cover img { max-width: 100%; max-height: 100%; object-fit: contain; transform: rotate(3deg); }
.pf-cover-empty .icon { width: 46px; height: 46px; color: color-mix(in srgb, var(--pc) 55%, #fff); transform: rotate(3deg); }
.pf-body { position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 160px; padding: 12px 12px 10px; color: #fff; border-radius: 0 10px 10px 10px;
    background: linear-gradient(170deg, color-mix(in srgb, var(--pc) 72%, #fff) 0%, var(--pc) 100%); box-shadow: 0 3px 10px rgba(0, 0, 0, .12); }
.pf-tab { position: absolute; left: 0; top: -22px; height: 24px; padding: 4px 26px 0 10px; font-size: 12px; color: rgba(255, 255, 255, .85);
    background: color-mix(in srgb, var(--pc) 72%, #fff); border-radius: 8px 8px 0 0; clip-path: polygon(0 0, 82% 0, 100% 100%, 0 100%); }
.pf.is-completed .pf-body, .pf.is-completed .pf-tab { filter: saturate(.35); }
.pf.is-archived .pf-body, .pf.is-archived .pf-tab { filter: grayscale(1) brightness(.85); }
.pf-parent { font-size: 12px; opacity: .85; }
.pf-title { color: #fff; font-weight: 700; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pf-title:hover { color: #fff; text-decoration: underline; }
.pf-title::after { content: ''; position: absolute; inset: 0; }
.pf-foot { margin-top: auto; display: flex; align-items: flex-end; gap: 6px; }
.pf-resp { flex: 1; min-width: 0; font-size: 12px; }
.pf-label { display: block; opacity: .8; margin-bottom: 3px; }
.pf-person { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.pf-menu-wrap { position: relative; z-index: 2; }
.pf-gear { color: rgba(255, 255, 255, .85); }
.pf-gear:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.pf-menu { min-width: 270px; z-index: 40; color: var(--text); }
.pf-menu .dd-link .icon { width: 16px; height: 16px; margin-right: 8px; flex: none; }
.pf-grid[data-searching] .pf[data-top="0"]:not([hidden]) { display: flex; }
.pf-grid:not([data-searching]) .pf[data-top="0"] { display: none; }

/* Доски проекта */
.desk-board { position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 120px; padding: 14px 14px 8px; background: var(--surface); border-radius: var(--radius); border-top: 4px solid var(--brand); box-shadow: 0 2px 8px rgba(0, 0, 0, .08); align-self: stretch; }
.desk-board:hover { box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 40%, transparent), 0 2px 8px rgba(0, 0, 0, .08); }
.desk-board.is-completed { border-top-color: #9a9a9a; background: color-mix(in srgb, var(--surface) 85%, #9a9a9a); }
.desk-board.is-archived { border-top-color: #3a3a3a; background: color-mix(in srgb, var(--surface) 70%, #3a3a3a); }
.desk-board-title { font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.desk-board-title::after { content: ''; position: absolute; inset: 0; }
.desk-board-foot { margin-top: auto; display: flex; align-items: center; gap: 6px; }
.desk-board-state { flex: 1; font-size: 12px; color: var(--muted); }
.desk-board .pf-gear { color: var(--muted); }
.desk-board .pf-gear:hover { background: var(--surface-2); color: var(--text); }

/* Таблица проектов */
.desk-table-card { padding: 6px 10px; }
.projects-table th button { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: inherit; cursor: pointer; text-align: left; }
.projects-table th button::after { content: ' ⇅'; opacity: .35; font-size: 11px; }
.projects-table th button[data-dir="asc"]::after { content: ' ▲'; opacity: .8; }
.projects-table th button[data-dir="desc"]::after { content: ' ▼'; opacity: .8; }
.projects-table .pf-gear { color: var(--muted); }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 320px; }
.nowrap { white-space: nowrap; }

/* Окна «Создание нового проекта / доски» */
.desk-dialog { width: min(480px, calc(100vw - 32px)); padding: 18px 20px; border: 0; border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); color: var(--text); background: var(--surface); }
.desk-dialog::backdrop, .ppt::backdrop { background: rgba(20, 20, 20, .45); }
.desk-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.desk-dialog-head h2 { margin: 0; font-size: 18px; color: var(--brand); }
:root[data-theme="dark"] .desk-dialog-head h2 { color: var(--text); }
.desk-dialog-foot { display: flex; gap: 8px; margin-top: 12px; }

/* «Паспорт проекта» (3.2.3 v4): слева сведения, справа «Действия» */
.ppt { width: min(1180px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; border: 0; background: transparent; color: var(--text); overflow: visible; }
.ppt[open] { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; }
.ppt-main, .ppt-menu { background: var(--surface); border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); max-height: calc(100vh - 40px); overflow: auto; }
.ppt-main { padding: 18px 32px 26px; }
.ppt-head { position: sticky; top: -18px; z-index: 2; display: flex; align-items: center; gap: 10px; margin: -18px -32px 10px; padding: 16px 32px 10px; background: var(--surface); border-bottom: 1px solid var(--border); }
.ppt-head h2 { flex: 1; margin: 0; text-align: center; font-size: 20px; color: var(--brand); }
:root[data-theme="dark"] .ppt-head h2 { color: var(--text); }
.ppt-big { margin: 10px 0 14px; text-align: center; font-weight: 500; font-size: 19px; }
.ppt-cover-view { display: block; max-width: 220px; max-height: 120px; margin: 4px auto 0; object-fit: contain; }
.ppt-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 10px; margin: 0 0 12px; }
.ppt-facts dt { font-weight: 700; }
.ppt-facts dd { margin: 0; }
.ppt-block { margin: 14px 0; }
.ppt-block h4 { margin: 0 0 4px; font-size: 15px; }
.ppt-person { display: inline-flex; align-items: center; gap: 6px; }
.ppt-people { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.ppt-list { margin: 0; padding-left: 18px; }
.ppt-list li { margin: 3px 0; }
.ppt-member { display: flex; align-items: center; gap: 8px; list-style: none; margin-left: -18px; }
.ppt[data-mode="view"] [data-ppt-edit], .ppt[data-mode="edit"] [data-ppt-view] { display: none; }
.ppt[data-mode="view"] [data-ppt-to-view], .ppt[data-mode="edit"] [data-ppt-to-edit] { display: none; }
.ppt-edit .field input, .ppt-edit .field textarea, .ppt-edit .field select { border-radius: 10px; }
.ppt-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ppt-cover { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 90px; padding: 12px; border: 2px dashed var(--border); border-radius: 10px; }
.ppt-cover.is-over { border-color: var(--brand); background: var(--brand-soft); }
.ppt-cover img { max-width: 180px; max-height: 100px; object-fit: contain; }
.ppt-saved { color: var(--ok); }
.ppt-menu { padding: 18px 20px; display: flex; flex-direction: column; }
.ppt-menu-head h3 { margin: 0 0 8px; font-size: 16px; }
.ppt-actions form { margin: 0; }
.ppt-actions .dd-link .icon, .ppt-actions summary .icon { width: 16px; height: 16px; margin-right: 8px; color: var(--brand); flex: none; }
.ppt-actions summary { display: flex; align-items: center; }
.ppt-actions .dd-item > summary { list-style: none; cursor: pointer; padding: 8px 10px; border-radius: 8px; font-size: 14px; }
.ppt-actions .dd-item > summary:hover { background: var(--surface-2); }
.ppt-colors .color-pick { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 10px 10px; }
.ppt-swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5); }
.ppt-swatch.is-active { border-color: var(--text); }
.ppt-about { margin-top: auto; padding: 14px 0 0 12px; border-left: 2px solid var(--border); color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 860px) {
    .ppt[open] { grid-template-columns: minmax(0, 1fr); width: 100vw; max-width: 100vw; max-height: 100vh; height: 100vh; margin: 0; gap: 0; overflow: auto; }
    .ppt-main, .ppt-menu { max-height: none; overflow: visible; border-radius: 0; box-shadow: none; }
    .ppt-main { padding: 14px 16px 18px; }
    .ppt-head { top: 0; margin: -14px -16px 10px; padding: 12px 16px 10px; }
    .ppt-menu { border-top: 6px solid var(--surface-2); }
    .ppt-facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .ppt-facts dd { margin-bottom: 6px; }
    .ppt-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
    .desk-recent { grid-template-columns: minmax(0, 1fr); }
    .desk-recent-card { min-height: 0; padding-bottom: 14px; padding-right: 44px; }
    .desk-recent-forget { bottom: auto; top: 50%; transform: translateY(-50%); }
    .desk-bar { gap: 8px; }
    .desk-search { width: 100%; order: 3; }
    .desk-sort select { min-width: 0; }
    .pf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 10px; }
    .pf-cover { height: 80px; margin: 0 8px -16px; }
    .pf-body { min-height: 140px; }
}
@media (max-width: 420px) { .pf-title { font-size: 14px; } .pf-person { font-size: 12px; } }
.ppt:focus, .ppt-main:focus, .ppt-menu:focus { outline: none; }
.ppt-person { gap: 10px; }
.ppt-person .avatar-wrap, .ppt-people .ppt-person { margin-left: 4px; }
.ppt-people { gap: 10px 22px; }
/* С. 53 (замечание Романа 27.10): открытое меню ⚙ — поверх соседних папок и досок (у обложки соседа свой слой из-за поворота) */
.pf:has(.dropdown:not([hidden])), .desk-board:has(.dropdown:not([hidden])), .projects-table tr:has(.dropdown:not([hidden])) { z-index: 60; }
.projects-table tr:has(.dropdown:not([hidden])) { position: relative; }
/* С. 53, съёмка описаний: таблица проектов умещается на ПК (⚙ видна без прокрутки), меню на телефоне не уходят за край */
.projects-table th { white-space: normal; vertical-align: bottom; }
.projects-table .clamp-2 { max-width: 220px; }
@media (max-width: 760px) {
    .desk-tools { left: 0; right: auto; }
    .pf-menu { position: fixed; left: 12px; right: 12px; top: auto; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); max-height: 70vh; overflow: auto; min-width: 0; z-index: 70; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); }
}
.projects-table { width: 100%; table-layout: fixed; }
.projects-table th:nth-child(1) { width: 96px; }
.projects-table th:nth-child(3) { width: 124px; }
.projects-table th:nth-child(4), .projects-table th:nth-child(5) { width: 20%; }
.projects-table th:nth-child(6) { width: 48px; }
.projects-table td { overflow-wrap: anywhere; }
.projects-table .clamp-2 { max-width: none; }
@media (max-width: 760px) { .projects-table { table-layout: auto; min-width: 640px; } }
.projects-table td { white-space: normal; }

/* С. 54: форма документа — несколько категорий, быстрое создание вида и категории */
.doc-quick { display: inline-block; margin-top: 4px; font-size: 13px; }
.label-like { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.doc-extra-cats { max-height: 200px; }
.doc-quick-dialog { width: min(520px, calc(100vw - 24px)); }
.doc-quick-dialog h2 { margin-top: 0; }
.docs-share-btn { display: inline-flex; vertical-align: -3px; margin-left: 6px; padding: 2px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 4px; }
.docs-share-btn:hover { color: var(--brand); background: var(--surface-2); }
.docs-share-btn .icon { width: 16px; height: 16px; }
.docs-switch { margin-bottom: 12px; }
.doc-import-date { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.doc-import-date input { width: auto; border-radius: var(--radius); }
.doc-import-table td, .doc-import-table th { font-size: 14px; }
.doc-import-table .num { text-align: right; }
/* С. 54: журнал документов — на всю ширину окна (на широких экранах справа было пустое поле) */
:root .page-docs .content-inner, html.sidebar-mini .page-docs .content-inner { max-width: none; }


/* ЭДО, сессия 55 (интерфейс 08): карточка и форма документа в раскладке раздела — строка действий сверху,
   реквизиты/поля слева, PDF справа (рядом — когда рабочей области хватает ширины: container query). */
.doc-main { container-type: inline-size; display: grid; gap: 16px; align-content: start; min-width: 0; }
.doc-bar { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 10px 14px; }
.doc-bar-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1 1 260px; min-width: 0; }
.doc-bar-title strong { font-size: 16px; overflow-wrap: anywhere; }
.doc-bar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.doc-bar-sticky { position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 20; }
.doc-form > .doc-bar { margin-bottom: 16px; }
.btn.danger, .btn-ghost.danger { color: var(--danger); }
.doc-more-menu { position: relative; }
.doc-more-menu > summary { list-style: none; }
.doc-more-menu > summary::-webkit-details-marker { display: none; }
.doc-more-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 230px; padding: 6px; display: grid; gap: 2px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14); }
.doc-more-list form { margin: 0; }
.doc-more-list a, .doc-more-list button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.doc-more-list a:hover, .doc-more-list button:hover { background: var(--surface-2); text-decoration: none; }
.doc-more-list .danger { color: var(--danger); }
.doc-made { margin: 12px 0 0; }
.doc-pdf-frame { height: 70vh; }
@container (min-width: 820px) {
    .doc-view { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
    .doc-view .doc-pdf { position: sticky; top: calc(var(--topbar-h) + 12px); }
    .doc-view .doc-pdf-frame { height: calc(100vh - var(--topbar-h) - 140px); min-height: 420px; }
}
/* форма */
.doc-edit { display: grid; gap: 16px; align-items: start; }
.doc-edit-fields { container-type: inline-size; display: grid; gap: 16px; align-content: start; min-width: 0; }
.doc-edit-fields > .card { margin: 0; }
.doc-edit-pdf .field { margin-bottom: 10px; }
.doc-pdf-empty { display: grid; place-items: center; gap: 10px; min-height: 40vh; padding: 24px; text-align: center; color: var(--muted); border: 2px dashed var(--border); border-radius: var(--radius); }
.doc-pdf-empty .icon { width: 40px; height: 40px; }
.doc-pdf-empty p { margin: 0; max-width: 280px; }
@container (min-width: 860px) {
    .doc-edit { grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); }
    .doc-edit-pdf { position: sticky; top: calc(var(--topbar-h) + 80px); }
    .doc-edit-pdf .doc-pdf-frame, .doc-edit-pdf .doc-pdf-empty { height: calc(100vh - var(--topbar-h) - 230px); min-height: 380px; }
}
@container (max-width: 420px) { .doc-edit-fields .form-grid { grid-template-columns: minmax(0, 1fr); } }
.doc-parties-cols { display: grid; gap: 18px; }
.doc-parties-cols .doc-parties + .doc-parties { margin-top: 0; }
/* автор и адресат — как в v4: поля организации, должности и ФИО друг под другом, две колонки — когда хватает ширины */
.doc-parties-cols .doc-party { grid-template-columns: minmax(0, 1fr) auto; padding-bottom: 8px; border-bottom: 1px dashed var(--border); }
.doc-parties-cols .doc-party input { grid-column: 1; }
.doc-parties-cols .doc-party [data-doc-party-remove] { grid-column: 2; grid-row: 1; }
@container (min-width: 420px) { .doc-parties-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.doc-links-filter { margin-top: 10px; }
.doc-links-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 440px; overflow-y: auto; }
.doc-links-list li { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.doc-links-list li:last-child { border-bottom: 0; }
.doc-links-list li .muted { display: block; }
.doc-links-list li.is-new { background: var(--ok-soft); border-radius: var(--radius-sm); }
@media (max-width: 760px) {
    .doc-bar-sticky { position: static; }
    .doc-bar-actions .btn { flex: 1 1 auto; justify-content: center; }
    .doc-bar-actions .btn-icon, .doc-more-menu { flex: 0 0 auto; }
    .doc-nav { display: flex; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; padding: 4px; }
    .doc-nav .btn { flex: 1 0 auto; justify-content: center; padding-left: 8px; padding-right: 8px; }
}


/* С. 55: «часики» — сохранение и загрузка документа */
.busy-clock { position: relative; display: inline-block; width: 22px; height: 22px; flex: none; border: 2px solid currentColor; border-radius: 50%; color: var(--brand); }
.busy-clock i { position: absolute; left: 50%; bottom: 50%; width: 2px; margin-left: -1px; background: currentColor; border-radius: 2px; transform-origin: 50% 100%; }
.busy-clock i:first-child { height: 38%; animation: busy-turn 1.2s linear infinite; }
.busy-clock i:last-child { height: 26%; animation: busy-turn 14.4s linear infinite; }
.busy-clock-lg { width: 48px; height: 48px; border-width: 3px; }
.busy-clock-lg i { width: 3px; margin-left: -1.5px; }
@keyframes busy-turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .busy-clock i:first-child { animation-duration: 4s; } }
.busy-overlay { position: fixed; inset: 0; z-index: 5000; display: grid; place-items: center; padding: 16px; background: rgba(20, 20, 30, .35); animation: busy-in .15s ease; }
.busy-box { display: grid; justify-items: center; gap: 10px; min-width: 260px; max-width: 360px; padding: 26px 28px; text-align: center; }
.busy-box strong { font-size: 17px; }
@keyframes busy-in { from { opacity: 0; } }
.doc-pdf-box { position: relative; }
.busy-inline { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); background: var(--surface-2); border-radius: var(--radius-sm); pointer-events: none; }
.doc-pdf-box.is-loaded .busy-inline { display: none; }
.doc-pdf-box:not(:has(iframe[src])) .busy-inline { display: none; }
/* финансирование документа: дебет и кредит × план / обязательства / факт */
.doc-fin-table { border-spacing: 6px 6px; margin: 0 -6px; }
.doc-fin-table thead th:first-child, .doc-fin-table tbody th { width: 92px; }
.doc-fin-table thead th { vertical-align: bottom; line-height: 1.2; }
.doc-fin-table tbody th { line-height: 1.2; font-size: 13px; }
.doc-fin-table input { padding: 0 6px; font-size: 13px; text-align: right; }
.doc-fin-view { width: 100%; border-collapse: collapse; font-size: 13px; margin: 0 0 16px; }
.doc-fin-view th, .doc-fin-view td { padding: 5px 4px; border-bottom: 1px solid var(--border); text-align: right; }
.doc-fin-view td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.doc-fin-view thead th { line-height: 1.2; vertical-align: bottom; }
.doc-fin-view thead th { color: var(--muted); font-weight: 600; font-size: 13px; }
.doc-fin-view th[scope=row] { text-align: left; font-weight: 600; }

/* С. 56 — интерфейс 09 «ЭДО: справочники и загрузки» */
.docs-tree-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.docs-fold-all { display: inline-flex; gap: 2px; margin-left: auto; }
.docs-fold, .docs-fold-gap { flex: none; width: 24px; height: 24px; }
.docs-fold { display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
    color: var(--brand); font-weight: 700; font-size: 15px; line-height: 1; cursor: pointer; }
.docs-fold:hover { background: var(--surface-2); }
.docs-tree li.is-folded > .docs-tree { display: none; }
.docs-form-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.docs-made { margin: -6px 0 12px; }
.doc-bar-actions form { margin: 0; }
.docs-fold-all .btn { flex: none; white-space: nowrap; }
.docs-tree-head .btn-primary { flex: none; }
/* с. 56: дерево/список и форма рядом, пока хватает места; иначе — друг под другом (форма сверху) */
.page-docs .docs-split { container-type: inline-size; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
.docs-fold-btn { height: 30px; padding: 0 10px; font-size: 13px; }
/* с. 56: на телефоне ярлык роли/«входящие» у категории уходит на следующую строку, название не переносится по буквам */
@media (max-width: 600px) { .docs-tree-item { flex-wrap: wrap; } .docs-tree-item .chip { margin-left: 26px; } }

/* ——— С. 57: Общение как в Telegram (решение Романа 27.10): две колонки — список чатов и переписка; сведения о чате — панелью по щелчку на шапку ——— */
:root .page-chat .content-inner, html.sidebar-mini .page-chat .content-inner { max-width: none; margin: 0; }
.page-chat .content { padding: 0; } /* с. 57, замечание Романа: общение на всё окно, без «окна в окне» */
@media (min-width: 861px) {
    .page-chat .content { display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h) - var(--footer-h, 40px) - var(--banner-h, 0px)); min-height: 460px; }
    .page-chat .content-inner { flex: 1; min-height: 0; display: flex; flex-direction: column; width: 100%; }
}
.icon.rot90 { transform: rotate(90deg); }
.page-chat .shell { min-height: 0; }
@media (min-width: 861px) { .page-chat .sidebar { height: calc(100vh - var(--topbar-h) - var(--footer-h) - var(--banner-h, 0px)); } }
.chat-layout { --chat-accent: var(--brand); --chat-mine: color-mix(in srgb, var(--brand) 14%, var(--surface)); --chat-wall: color-mix(in srgb, var(--brand) 5%, var(--bg));
    flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
    overflow: hidden; background: var(--surface); position: relative; }
:root[data-theme="standard"] .chat-layout { --chat-accent: #5d5fef; --chat-mine: #e6e6fd; --chat-wall: #eef0f8; }
:root[data-theme="light"] .chat-layout { --chat-mine: #e9f4df; --chat-wall: #f2f3f5; --chat-accent: #2f7de1; }
:root[data-theme="dark"] .chat-layout { --chat-mine: #2b3a52; --chat-wall: #161616; --chat-accent: #8ab4ff; }
.chat-side, .chat-main { min-height: 0; display: flex; flex-direction: column; }
.chat-ico { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; flex: none; text-decoration: none; position: relative; }
.chat-ico:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.chat-ico .icon { width: 20px; height: 20px; }

/* Левая колонка */
.chat-side { border-right: 1px solid var(--border); background: var(--surface); position: relative; }
.chat-side-top { display: flex; align-items: center; gap: 6px; padding: 10px 10px 6px; }
.chat-side-menu { position: relative; }
.chat-side-menu > summary { list-style: none; }
.chat-side-menu > summary::-webkit-details-marker { display: none; }
.chat-side-menu .chat-pop { left: 0; top: calc(100% + 4px); }
.chat-search { flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 40px; border: 1px solid transparent; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.chat-search:focus-within { border-color: var(--chat-accent); background: var(--surface); }
.chat-search .icon { width: 18px; height: 18px; flex: none; }
.chat-search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: inherit; color: var(--text); height: 100%; }
.chat-search.is-light { margin: 0 0 10px; }
.chat-folders { display: flex; gap: 2px; padding: 0 8px; border-bottom: 1px solid var(--border); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.chat-folders::-webkit-scrollbar { display: none; }
.chat-folder { display: inline-flex; align-items: center; gap: 5px; padding: 9px 8px; font-size: 13.5px; font-weight: 550; color: var(--muted); text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; border-radius: 6px 6px 0 0; }
.chat-folder:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.chat-folder.is-active { color: var(--chat-accent); border-bottom-color: var(--chat-accent); }
.chat-folder-n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--chat-accent); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
:root[data-theme="dark"] .chat-folder-n { color: #141414; }
.chat-side-title { display: flex; align-items: center; gap: 6px; padding: 2px 10px 8px; border-bottom: 1px solid var(--border); font-size: 16px; }
.chat-side-body { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 6px 80px; scrollbar-width: thin; }
.chat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.chat-list > li[hidden] { display: none; }
.chat-item { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 10px; color: var(--text); text-decoration: none; position: relative; }
.chat-item:hover { text-decoration: none; background: var(--surface-2); }
.chat-item.is-current { background: var(--chat-accent); color: #fff; }
:root[data-theme="dark"] .chat-item.is-current { color: #141414; }
.chat-item.is-current .chat-item-preview, .chat-item.is-current .chat-item-date, .chat-item.is-current .chat-ticks, .chat-item.is-current .chat-item-flag, .chat-item.is-current .chat-item-pin { color: inherit; opacity: .9; }
.chat-item.is-current .chat-unread { background: #fff; color: var(--chat-accent); }
.chat-item-ava { flex: none; display: inline-flex; }
.chat-item-ava .avatar, .chat-item-ava .chat-avatar, .chat-item-ava img { border-radius: 50%; }
.chat-ava-icon { display: grid !important; place-items: center; background: color-mix(in srgb, var(--chat-accent) 18%, var(--surface)); color: var(--chat-accent); }
.chat-ava-icon .icon { width: 24px; height: 24px; }
.chat-item-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.chat-item-top, .chat-item-bottom { display: flex; align-items: center; gap: 6px; min-width: 0; }
.chat-item-top strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 15px; }
.chat-item-date { flex: none; font-size: 12px; color: var(--muted); display: inline-flex; gap: 3px; align-items: center; }
.chat-item-flag, .chat-item-pin { flex: none; color: var(--muted); display: inline-flex; }
.chat-item-flag .icon, .chat-item-pin .icon { width: 14px; height: 14px; }
.chat-item-preview { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; color: var(--muted); }
.chat-item-who { color: var(--text); }
.chat-item.is-current .chat-item-who { color: inherit; }
.chat-item-invite { color: var(--chat-accent); }
.chat-unread { flex: none; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--chat-accent); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
:root[data-theme="dark"] .chat-unread { color: #141414; }
.chat-item.is-muted .chat-unread { background: color-mix(in srgb, var(--muted) 70%, transparent); color: #fff; }
.chat-ticks { color: var(--chat-accent); font-size: 12px; letter-spacing: -3px; padding-right: 3px; }
.chat-ticks:not(.is-read) { color: var(--muted); }
.chat-archive-row { margin-bottom: 1px; }
.chat-empty { padding: 14px 10px; font-size: 13.5px; color: var(--muted); list-style: none; }
.chat-avatar { background: color-mix(in srgb, var(--chat-accent) 22%, var(--surface)); color: var(--chat-accent); object-fit: cover; flex: none; font-weight: 700; }
.chat-fab { position: absolute; right: 16px; bottom: 16px; width: 54px; height: 54px; border: 0; border-radius: 50%; background: var(--chat-accent); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); transition: transform .15s; }
:root[data-theme="dark"] .chat-fab { color: #141414; }
.chat-fab:hover { transform: scale(1.06); }
.chat-fab .icon { width: 24px; height: 24px; }

/* Переписка */
.chat-main { position: relative; background: #e8e8f0 url(img/gears-bg.jpg) center / cover no-repeat; } /* поле переписки — рисунок с шестерёнками (замечание Романа) */
:root[data-theme="light"] .chat-main { background: linear-gradient(rgba(255, 255, 255, .5), rgba(255, 255, 255, .5)), #f2f3f5 url(img/gears-bg.jpg) center / cover no-repeat; }
:root[data-theme="dark"] .chat-main { background: linear-gradient(rgba(14, 14, 14, .8), rgba(14, 14, 14, .8)), #161616 url(img/gears-bg.jpg) center / cover no-repeat; }
.chat-head { display: flex; align-items: center; gap: 4px; padding: 6px 10px; min-height: 58px; background: var(--surface); border-bottom: 1px solid var(--border); position: relative; z-index: 3; }
.chat-head-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 4px 6px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.chat-head-main:hover { background: var(--surface-2); }
.chat-head-ava .avatar, .chat-head-ava .chat-avatar, .chat-head-ava img { border-radius: 50%; }
.chat-head-text { display: grid; min-width: 0; }
.chat-head-title { font-size: 16px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head-sub.is-typing { color: var(--chat-accent); }
.chat-head-flag { color: var(--muted); display: inline-flex; padding: 0 4px; }
.chat-head-flag .icon { width: 16px; height: 16px; }
.chat-head .chat-back { display: none; }
.chat-msearch { background: var(--surface); border-bottom: 1px solid var(--border); padding: 8px 12px 0; position: relative; z-index: 4; }
.chat-msearch-list { list-style: none; margin: 0; padding: 0 0 8px; max-height: 40vh; overflow-y: auto; }
.chat-msearch-list a { display: grid; gap: 2px; padding: 7px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; }
.chat-msearch-list a:hover { background: var(--surface-2); text-decoration: none; }
.chat-msearch-list .muted { font-size: 12px; }
.chat-pinned { display: flex; align-items: center; gap: 6px; padding: 4px 8px 4px 14px; background: var(--surface); border-bottom: 1px solid var(--border); position: relative; z-index: 2; }
.chat-pinned-body { flex: 1; min-width: 0; display: flex; gap: 10px; align-items: center; padding: 4px 8px; border-left: 3px solid var(--chat-accent); color: var(--text); text-decoration: none; }
.chat-pinned-body:hover { text-decoration: none; background: var(--surface-2); }
.chat-pinned-body > span { display: grid; min-width: 0; font-size: 13px; }
.chat-pinned-body strong { color: var(--chat-accent); font-size: 13px; }
.chat-pinned-body span span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-pinned-body .icon { width: 18px; height: 18px; color: var(--chat-accent); flex: none; }
.chat-placeholder { margin: auto; }
.chat-placeholder span { display: inline-block; padding: 6px 14px; border-radius: 999px; background: color-mix(in srgb, #000 22%, transparent); color: #fff; font-size: 14px; }
.chat-body { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.chat-messages { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 10px max(16px, calc((100% - 820px) / 2)) 12px; display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; }
.chat-messages.is-drop { outline: 3px dashed var(--chat-accent); outline-offset: -10px; }
.chat-older { align-self: center; margin: 6px 0; }
.chat-day { align-self: center; position: sticky; top: 4px; z-index: 2; margin: 10px 0 6px; pointer-events: none; }
.chat-day span { font-size: 13px; font-weight: 550; color: #fff; background: color-mix(in srgb, #000 28%, transparent); border-radius: 999px; padding: 3px 12px; }
.chat-unread-sep { align-self: stretch; text-align: center; margin: 8px -20px; padding: 4px 0; background: color-mix(in srgb, var(--surface) 80%, transparent); font-size: 13px; color: var(--chat-accent); font-weight: 600; }
.chat-empty-hint { margin: auto; text-align: center; }
.chat-empty-hint span { display: inline-block; padding: 8px 16px; border-radius: 14px; background: color-mix(in srgb, #000 22%, transparent); color: #fff; }
.chat-msg { display: flex; gap: 8px; align-items: flex-end; max-width: min(78%, 640px); position: relative; margin-top: 6px; }
.chat-msg.is-cont { margin-top: 0; }
.chat-msg.is-mine { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg-ava { flex: none; width: 34px; align-self: flex-end; }
.chat-msg-ava .avatar { border-radius: 50%; }
.chat-msg.has-next .chat-msg-ava { visibility: hidden; }
.chat-bubble { position: relative; background: var(--surface); border-radius: 14px 14px 14px 4px; padding: 6px 10px 6px 11px; min-width: 64px; outline: none; box-shadow: 0 1px 1.5px rgba(0, 0, 0, .13); }
.chat-msg.is-mine .chat-bubble { background: var(--chat-mine); border-radius: 14px 14px 4px 14px; }
.chat-msg.has-next .chat-bubble { border-bottom-left-radius: 14px; }
.chat-msg.is-mine.has-next .chat-bubble { border-bottom-right-radius: 14px; border-bottom-left-radius: 14px; }
.chat-msg.is-cont .chat-bubble { border-top-left-radius: 6px; }
.chat-msg.is-mine.is-cont .chat-bubble { border-top-left-radius: 14px; border-top-right-radius: 6px; }
.chat-msg:not(.has-next):not(.is-mine) .chat-bubble::before { content: ''; position: absolute; left: -7px; bottom: 0; width: 8px; height: 12px; background: inherit; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.chat-msg.is-mine:not(.has-next) .chat-bubble::before { content: ''; position: absolute; right: -7px; bottom: 0; width: 8px; height: 12px; background: inherit; clip-path: polygon(0 0, 100% 100%, 0 100%); }
.chat-bubble:focus-visible { box-shadow: 0 0 0 2px var(--chat-accent); }
.chat-author { font-size: 13.5px; font-weight: 650; color: var(--chat-accent); margin-bottom: 1px; }
.chat-msg.is-cont .chat-author { display: none; }
.chat-text { overflow-wrap: anywhere; line-height: 1.42; display: inline; white-space: normal; }
.chat-text a { color: var(--link, var(--chat-accent)); }
.chat-text .mention { color: var(--chat-accent); font-weight: 600; text-decoration: none; }
.chat-meta { float: right; display: inline-flex; align-items: center; gap: 3px; margin: 6px 0 -4px 10px; font-size: 11.5px; color: var(--muted); white-space: nowrap; position: relative; top: 2px; }
.chat-meta .icon { width: 12px; height: 12px; }
.chat-bubble::after { content: ''; display: block; clear: both; }
.chat-fwd { font-size: 12.5px; color: var(--chat-accent); margin-bottom: 3px; display: flex; gap: 4px; align-items: center; }
.chat-fwd .icon { width: 14px; height: 14px; }
.chat-reply { display: grid; font-size: 13px; border-left: 3px solid var(--chat-accent); padding: 3px 8px; margin: 2px 0 5px; text-decoration: none; background: color-mix(in srgb, var(--chat-accent) 9%, transparent); border-radius: 4px 8px 8px 4px; color: var(--text); }
.chat-reply strong { color: var(--chat-accent); font-size: 13px; }
.chat-reply span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.chat-reply:hover { text-decoration: none; background: color-mix(in srgb, var(--chat-accent) 15%, transparent); }
.chat-msg.is-flash .chat-bubble { box-shadow: 0 0 0 3px var(--chat-accent); }
.chat-msg.is-deleted .chat-bubble { background: color-mix(in srgb, var(--surface) 60%, transparent); box-shadow: none; }
.chat-files { display: grid; gap: 6px; margin: 2px 0 4px; }
.chat-files.is-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; }
.chat-files.is-gallery img { width: 100%; height: 160px; object-fit: cover; max-width: none; }
.chat-img { display: block; cursor: zoom-in; }
.chat-img img { max-width: min(360px, 100%); max-height: 320px; border-radius: 10px; display: block; }
.chat-file { display: flex; align-items: center; gap: 10px; padding: 4px 2px; border-radius: 8px; color: var(--text); text-decoration: none; max-width: 320px; }
.chat-file:hover { text-decoration: none; }
.chat-file .file-ext { border-radius: 50%; background: var(--chat-accent); color: #fff; font-size: 10px; }
.chat-file-info { display: grid; min-width: 0; }
.chat-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.chat-voice { display: flex; align-items: center; gap: 10px; min-width: 220px; padding: 2px 0; }
.chat-voice-play { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--chat-accent); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.chat-voice-play .icon { width: 18px; height: 18px; }
.chat-voice-bar { flex: 1; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--chat-accent) 25%, transparent); position: relative; cursor: pointer; overflow: hidden; }
.chat-voice-bar span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--chat-accent); }
.chat-voice-time { font-size: 12px; color: var(--muted); min-width: 34px; }
.chat-msg-tools { position: relative; align-self: center; flex: none; }
.chat-msg-dots { opacity: 0; width: 30px; height: 30px; }
.chat-msg:hover .chat-msg-dots, .chat-msg:focus-within .chat-msg-dots, .chat-msg.menu-open .chat-msg-dots { opacity: 1; }
@media (hover: none) { .chat-msg-dots { display: none; } }
.chat-reactions { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 0; }
.chat-reaction { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; font: inherit; font-size: 14px; line-height: 1.5; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--chat-accent) 12%, transparent); color: var(--chat-accent); cursor: pointer; }
.chat-reaction span { font-size: 12px; font-weight: 600; }
.chat-reaction.is-mine { background: var(--chat-accent); color: #fff; }
.chat-reaction.is-mine span { color: #fff; }
.chat-pop { position: absolute; z-index: 40; min-width: 230px; padding: 6px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 32px rgba(0, 0, 0, .2); display: grid; gap: 1px; }
.chat-pop[hidden] { display: none; }
.chat-msg-menu { position: fixed; z-index: 70; }
.chat-pop-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; white-space: nowrap; text-decoration: none; }
.chat-pop-item:hover, .chat-pop-item:focus-visible { background: var(--surface-2); outline: none; text-decoration: none; }
.chat-pop-item .icon { width: 17px; height: 17px; color: var(--muted); }
.chat-pop-item.danger, .chat-pop-item.danger .icon { color: var(--danger); }
.chat-pop form { margin: 0; }
.chat-pop-emoji { display: flex; gap: 2px; padding: 2px 2px 6px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.chat-pop-emoji button { width: 32px; height: 32px; font-size: 20px; line-height: 1; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; transition: transform .1s; }
.chat-pop-emoji button:hover { background: var(--surface-2); transform: scale(1.18); }
.chat-pop-emoji .chat-pop-more { font-size: 16px; color: var(--muted); }
.chat-edit-box { display: grid; gap: 6px; min-width: min(420px, 62vw); }
.chat-edit-box textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; resize: vertical; background: var(--surface); color: var(--text); }
.chat-edit-box div { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.chat-jump { position: absolute; right: 18px; bottom: 14px; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--surface); color: var(--muted); box-shadow: 0 2px 8px rgba(0, 0, 0, .2); display: grid; place-items: center; cursor: pointer; z-index: 5; }
.chat-jump[hidden] { display: none; }
.chat-jump .icon { width: 22px; height: 22px; }
.chat-jump-n { position: absolute; top: -6px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--chat-accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.chat-jump-n[hidden] { display: none; }
.chat-invite-center { margin: auto; text-align: center; padding: 24px 28px; display: grid; justify-items: center; gap: 12px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); }
.chat-invite-center p { margin: 0; font-size: 19px; line-height: 1.35; }
.chat-invite-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.chat-invite-btns form { margin: 0; }
.chat-invite-ava .avatar, .chat-invite-ava .chat-avatar, .chat-invite-ava img { border-radius: 50%; }
.chat-invite-bar { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 8px 14px; flex-wrap: wrap; margin: 0; background: var(--surface); }
.chat-invite-bar form { margin: 0; }

/* Поле ввода: как в Telegram — пузырь с 😊 и скрепкой, справа круглая кнопка: микрофон, а при тексте — «самолётик» */
.chat-compose { padding: 6px max(14px, calc((100% - 860px) / 2)) 12px; display: grid; gap: 4px; position: relative; }
/* Канбанчик стоит в правом нижнем углу окна — поле ввода и кнопка «микрофон / отправить» отступают от него */
@media (min-width: 861px) { .chat-compose { padding-right: max(100px, calc((100% - 860px) / 2)); } .chat-jump { right: 28px; } }
.chat-compose-row { display: flex; align-items: flex-end; gap: 8px; }
.chat-compose-box { flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 2px; padding: 4px; border-radius: 14px; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .14); }
.chat-compose textarea { flex: 1; min-width: 0; resize: none; max-height: 220px; min-height: 40px; padding: 9px 4px; border: 0; outline: none; background: none; color: var(--text); font: inherit; font-size: 15px; line-height: 1.4; }
.chat-attach { cursor: pointer; }
.chat-emoji-btn { font-size: 20px; }
.chat-round { width: 50px; height: 50px; border: 0; border-radius: 50%; background: var(--surface); color: var(--chat-accent); display: grid; place-items: center; cursor: pointer; flex: none; box-shadow: 0 1px 2px rgba(0, 0, 0, .14); transition: transform .12s; }
.chat-round:hover { transform: scale(1.05); }
.chat-round[hidden] { display: none; }
.chat-round .icon { width: 24px; height: 24px; }
.chat-send { background: var(--chat-accent); color: #fff; }
:root[data-theme="dark"] .chat-send { color: #141414; }
.chat-mic.is-rec { background: #e53935; color: #fff; animation: chatPulse 1.2s infinite; }
@keyframes chatPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(229, 57, 53, .45); } 50% { box-shadow: 0 0 0 10px rgba(229, 57, 53, 0); } }
.chat-rec { flex: 1; display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; min-height: 48px; border-radius: 14px; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .14); }
.chat-rec[hidden] { display: none; }
.chat-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #e53935; animation: chatBlink 1s infinite; }
@keyframes chatBlink { 50% { opacity: .2; } }
.chat-rec-time { font-variant-numeric: tabular-nums; font-weight: 600; }
.chat-rec-hint { color: var(--muted); font-size: 13px; }
.chat-compose .error:empty { display: none; }
.chat-compose .error { background: var(--surface); border-radius: 8px; padding: 2px 8px; }
.chat-reply-bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px; background: var(--surface); font-size: 13px; color: var(--muted); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.chat-reply-bar[hidden] { display: none; }
.chat-reply-bar > .icon { color: var(--chat-accent); width: 18px; height: 18px; flex: none; }
.chat-reply-to { flex: 1; min-width: 0; border-left: 3px solid var(--chat-accent); padding-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-mentions { list-style: none; margin: 0; padding: 4px; position: absolute; left: max(14px, calc((100% - 860px) / 2)); bottom: calc(100% - 4px); width: min(340px, calc(100% - 28px)); max-height: 260px; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); z-index: 20; }
.chat-mentions[hidden] { display: none; }
.chat-mentions li { padding: 7px 10px; border-radius: 8px; cursor: pointer; display: grid; font-size: 14px; }
.chat-mentions li small { color: var(--muted); }
.chat-mentions li.is-active, .chat-mentions li:hover { background: var(--surface-2); }

/* Сведения о чате — панель справа поверх переписки */
.chat-info { position: absolute; top: 0; right: 0; bottom: 0; width: min(380px, 100%); z-index: 30; background: var(--surface); border-left: 1px solid var(--border);
    box-shadow: -10px 0 30px rgba(0, 0, 0, .14); display: flex; flex-direction: column; animation: chatSlide .18s ease-out; }
.chat-info[hidden] { display: none; }
@keyframes chatSlide { from { transform: translateX(30px); opacity: 0; } }
.chat-info-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 16px; min-height: 58px; border-bottom: 1px solid var(--border); font-size: 16px; }
.chat-info-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 0 70px; scrollbar-width: thin; }
.chat-info-head { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 22px 16px 16px; border-bottom: 8px solid var(--surface-2); }
.chat-info-ava { display: block; padding: 0; border: 0; background: none; border-radius: 50%; position: relative; color: inherit; }
.chat-info-ava .avatar, .chat-info-ava .chat-avatar, .chat-info-ava img { border-radius: 50%; }
.chat-info-ava.is-editable { cursor: pointer; }
.chat-info-ava.is-editable::after { content: '✎'; position: absolute; right: 4px; bottom: 4px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--chat-accent); color: #fff; font-size: 14px; box-shadow: 0 0 0 3px var(--surface); }
.chat-info-title { font-weight: 650; font-size: 18px; overflow-wrap: anywhere; }
.chat-info-sub { font-size: 13px; color: var(--muted); }
.chat-info-block { padding: 12px 16px; border-bottom: 8px solid var(--surface-2); }
.chat-info-cap { font-weight: 650; font-size: 15px; margin: 0 0 6px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.chat-info-cap > span { display: inline-flex; gap: 8px; align-items: center; }
.chat-info-cap .icon { width: 18px; height: 18px; color: var(--chat-accent); }
.chat-link-row { display: flex; gap: 4px; align-items: center; }
.chat-link-row input { flex: 1; min-width: 0; font: inherit; font-size: 13px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); }
.chat-link-acts { display: flex; gap: 12px; margin-top: 4px; }
.chat-link-acts form { margin: 0; }
.chat-link-block p { margin: 6px 0 0; }
.chat-acts { list-style: none; margin: 0; padding: 8px; display: grid; gap: 1px; border-bottom: 8px solid var(--surface-2); }
.chat-acts form { margin: 0; }
.chat-act { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 14.5px; text-align: left; cursor: pointer; }
.chat-act:hover { background: var(--surface-2); }
.chat-act .icon { width: 20px; height: 20px; color: var(--muted); flex: none; }
.chat-act.danger, .chat-act.danger .icon { color: var(--danger); }
.chat-users-open { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 650; cursor: pointer; }
.chat-users-open .icon { color: var(--chat-accent); width: 18px; height: 18px; }
.chat-members-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.chat-member { display: flex; align-items: center; gap: 6px; padding: 5px 2px; border-radius: 8px; }
.chat-member[hidden] { display: none; }
.chat-member:hover { background: var(--surface-2); }
.chat-member-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 16px; padding-left: 6px; color: var(--text); text-decoration: none; }
.chat-member-who:hover { text-decoration: none; color: var(--chat-accent); }
.chat-member-who .avatar { border-radius: 50%; }
.chat-member-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; display: grid; font-size: 14px; }
.chat-member-note { font-size: 11.5px; color: var(--muted); }
.chat-member-acts { display: inline-flex; align-items: center; gap: 0; flex: none; }
.chat-member-acts form { margin: 0; }
.chat-member-acts .chat-ico { width: 32px; height: 32px; }
.chat-member-acts .chat-ico .icon { width: 17px; height: 17px; }
.chat-star { display: inline-flex; color: #f2b632; padding: 0 4px; }
.chat-star .icon { width: 17px; height: 17px; }
.chat-member-menu { position: relative; }
.chat-member-menu > summary { list-style: none; }
.chat-member-menu > summary::-webkit-details-marker { display: none; }
.chat-member-menu .chat-pop { right: 0; top: calc(100% + 4px); }
.chat-users-more { margin-top: 6px; }
.chat-media-tabs { display: flex; gap: 2px; margin: -4px 0 10px; border-bottom: 1px solid var(--border); }
.chat-media-tabs button { flex: 1; padding: 8px 4px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.chat-media-tabs button.is-active { color: var(--chat-accent); border-bottom-color: var(--chat-accent); }
.chat-media-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
.chat-media-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; border-radius: 4px; }
.chat-media-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.chat-media-list li { display: grid; gap: 1px; }
.chat-media-link { display: flex; gap: 8px; align-items: center; overflow-wrap: anywhere; font-size: 14px; }
.chat-media-link .icon { width: 16px; height: 16px; flex: none; }

/* Окна */
.chat-members-dialog, .chat-forward-dialog { width: min(520px, calc(100vw - 24px)); }
.chat-members-dialog .chat-members-list, .chat-forward-list { max-height: min(56vh, 520px); overflow-y: auto; }
.chat-members-dialog .chat-member-name { color: var(--link, var(--brand)); }
.chat-members-dialog .desk-dialog-foot { justify-content: flex-end; }
.chat-forward-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.chat-forward-list li[hidden] { display: none; }
.chat-forward-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 7px 8px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.chat-forward-item:hover { background: var(--surface-2); }
.chat-forward-item .avatar, .chat-forward-item .chat-avatar, .chat-forward-item img { border-radius: 50%; }
.chat-create { display: grid; gap: 12px; }
.chat-create .desk-dialog-foot { margin-top: 2px; }
.chat-create .desk-dialog-foot .btn { flex: 1; justify-content: center; }
.chat-switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.chat-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chat-switch-ui { flex: none; width: 46px; height: 26px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); position: relative; transition: background .15s; }
.chat-switch-ui::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: left .15s; }
.chat-switch input:checked + .chat-switch-ui { background: var(--brand); border-color: var(--brand); }
.chat-switch input:checked + .chat-switch-ui::after { left: 22px; }
.chat-switch input:focus-visible + .chat-switch-ui { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.chat-switch > span:last-child { display: grid; gap: 1px; }
.people-pick { list-style: none; margin: 6px 0 0; padding: 4px; max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm, 8px); }
.people-pick li { padding: 3px 4px; }
.people-pick li[hidden] { display: none; }
.people-filter { width: 100%; }
.chat-avatar-form { display: grid; gap: 12px; }
.chat-avatar-drop { display: grid; justify-items: center; gap: 10px; padding: 18px; border: 2px dashed var(--border); border-radius: 12px; text-align: center; cursor: pointer; }
.chat-avatar-drop.is-over { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, transparent); }
.chat-avatar-preview .avatar, .chat-avatar-preview .chat-avatar, .chat-avatar-preview img { border-radius: 50%; width: 120px; height: 120px; object-fit: cover; }
.chat-files-dialog { width: min(640px, calc(100vw - 24px)); }
.chat-files-drop { border: 2px dashed var(--border); border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.chat-files-drop.is-over { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, transparent); }
.chat-files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.chat-files-grid:empty { display: none; }
.chat-file-tile { position: relative; display: grid; gap: 4px; justify-items: center; padding: 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 12px; text-align: center; }
.chat-file-tile img, .chat-file-tile .file-ext { width: 96px; height: 72px; object-fit: cover; border-radius: 6px; }
.chat-file-tile span { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-file-tile .chip-x { position: absolute; top: 2px; right: 2px; }
.chat-files-add { display: block; padding: 10px; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; }
.chat-files-dialog .field textarea { width: 100%; resize: vertical; font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.chat-lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(12, 12, 14, .92); color: #fff; }
.chat-lightbox[open] { display: grid; place-items: center; }
.chat-lightbox::backdrop { background: rgba(12, 12, 14, .92); }
.chat-lightbox img { max-width: calc(100vw - 140px); max-height: calc(100vh - 110px); object-fit: contain; border-radius: 4px; }
.chat-lb-btn { position: fixed; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; }
.chat-lb-btn:hover { background: rgba(255, 255, 255, .26); }
.chat-lb-btn .icon { width: 22px; height: 22px; }
.chat-lb-close { top: 14px; right: 14px; }
.chat-lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.chat-lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.chat-lb-btn[hidden] { display: none; }
.chat-lb-bar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 16px; justify-content: center; align-items: center; padding: 12px; font-size: 14px; }
.chat-lb-bar a { color: #fff; display: inline-flex; gap: 6px; align-items: center; }

/* Ползунки — в тон оформлению (правило с. 50) */
.chat-side-body, .chat-messages, .chat-info-scroll { scrollbar-color: var(--sb, color-mix(in srgb, var(--brand) 30%, #cfd0dc)) transparent; }
:root[data-theme="light"] .page-chat { --sb: #c9ccd2; }
:root[data-theme="dark"] .page-chat { --sb: #5c5c5c; }

@media (max-width: 1100px) {
    .chat-layout { grid-template-columns: minmax(270px, 320px) minmax(0, 1fr); }
}
@media (max-width: 860px) {
    .page-chat .content { padding: 0; }
    .chat-layout { grid-template-columns: minmax(0, 1fr); height: calc(100vh - var(--topbar-h) - var(--mobilebar-h, 60px) - var(--banner-h, 0px)); }
    .chat-layout.has-chat .chat-side { display: none; }
    .chat-layout:not(.has-chat) .chat-main { display: none; }
    .chat-head .chat-back { display: inline-flex; }
    .chat-msg { max-width: 88%; }
    .chat-msg-menu { left: 8px !important; right: 8px; top: auto !important; bottom: calc(var(--mobilebar-h, 60px) + 8px); }
    .chat-pop-emoji { justify-content: space-around; }
    .chat-lightbox img { max-width: 100vw; }
    .chat-lb-prev, .chat-lb-next { top: auto; bottom: 54px; transform: none; }
    .chat-info { width: 100%; }
    .page-chat .helper { bottom: calc(var(--mobilebar-h, 60px) + 136px); }
    .chat-fab { bottom: 14px; }
    .chat-round { width: 46px; height: 46px; }
}

/* Картинки объявлений во весь экран (с. 58) — на основе окна картинок «Общения» */
.ann-card .ann-text:not(.rte-area) img, .ann-card .ann-images a { cursor: zoom-in; }
.ann-lightbox .ann-lb-stage { position: fixed; inset: 0 0 50px; display: grid; place-items: center; overflow: auto; overscroll-behavior: contain; }
.ann-lightbox img { cursor: zoom-in; touch-action: pan-x pan-y pinch-zoom; }
.ann-lightbox.is-zoom .ann-lb-stage { place-items: start; }
.ann-lightbox.is-zoom img { max-width: none; max-height: none; cursor: zoom-out; margin: auto; }
.ann-lightbox .chat-lb-btn, .ann-lightbox .chat-lb-bar { z-index: 2; }
.ann-lb-name { opacity: .8; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 860px) {
    .ann-lightbox img { max-width: 100vw; max-height: calc(100vh - 120px); }
    .ann-lightbox .chat-lb-prev, .ann-lightbox .chat-lb-next { top: auto; bottom: 54px; transform: none; }
    .ann-lb-name { display: none; }
}

/* ——— Уведомления (интерфейс 12, с. 59) ——— */
.bell .bell-dnd { display: none; }
.bell.is-dnd .icon:not(.bell-dnd) { display: none; }
.bell.is-dnd .bell-dnd { display: inline-block; opacity: .75; }
.notif { position: relative; }
.notif-list .notif a { padding-right: 34px; }
.notif-who { position: relative; flex: none; width: 32px; height: 32px; }
.notif-who .avatar { width: 32px; height: 32px; }
.notif-kind { position: absolute; right: -4px; bottom: -4px; display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%; background: var(--surface); color: var(--muted); box-shadow: 0 0 0 1.5px var(--surface); }
.notif-kind svg { width: 11px; height: 11px; }
.notif-icon.notif-billing, .notif-kind.notif-billing { color: var(--warn); }
.notif-icon.notif-rating_soon, .notif-kind.notif-rating_soon, .notif-kind.notif-award { color: #a07a00; }
.notif-icon.notif-doc_shared, .notif-icon.notif-doc_comment, .notif-icon.notif-chat_mention, .notif-icon.notif-chat_invite, .notif-icon.notif-ann_reply { background: var(--brand-soft); color: var(--text); }
.notif-kind.notif-task_due { color: var(--danger); }
.notif-mark { position: absolute; top: 8px; right: 6px; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.notif-dropdown .notif-mark { width: 26px; display: inline-flex; padding: 0; }
.notif-mark .icon { display: none; width: 15px; height: 15px; }
.notif-mark .notif-dot { margin: 0; }
.notif-mark:hover, .notif-mark:focus-visible { background: var(--surface-2); color: var(--brand); }
.notif-mark:hover .notif-dot, .notif-mark:focus-visible .notif-dot { display: none; }
.notif-mark:hover .icon, .notif-mark:focus-visible .icon { display: inline-block; }
@media (hover: none) { .notif-mark .icon { display: inline-block; } .notif-mark .notif-dot { position: absolute; top: 0; right: 0; width: 7px; height: 7px; } }
.notif-head-tools { display: inline-flex; align-items: center; gap: 10px; }
.notif-dnd-line { padding: 6px 12px; background: var(--warn-soft); color: var(--warn); font-weight: 600; }
/* «Не беспокоить» */
.dnd { position: relative; }
.dnd > summary { list-style: none; display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 8px; border-radius: 15px; cursor: pointer; color: var(--muted); }
.dnd > summary::-webkit-details-marker { display: none; }
.dnd > summary:hover { background: var(--surface-2); color: var(--text); }
.dnd > summary .icon { width: 17px; height: 17px; }
.dnd > summary.is-on { background: var(--warn-soft); color: var(--warn); font-size: 12px; font-weight: 600; }
.dnd-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 70; width: 250px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: 0 8px 24px rgba(0,0,0,.16); display: flex; flex-direction: column; gap: 2px; }
.dnd-hint { padding: 4px 8px 6px; line-height: 1.35; }
.dnd-menu button, .dnd-menu a, .notif-dropdown .dnd-menu button, .notif-dropdown .dnd-menu a { display: block; width: 100%; padding: 7px 8px; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; text-decoration: none; cursor: pointer; }
.dnd-menu button:hover, .dnd-menu a:hover { background: var(--surface-2); }
.dnd-menu .dnd-off { color: var(--warn); font-weight: 600; }
.dnd-menu a { color: var(--brand) !important; font-size: 13px; }
/* Страница «Уведомления» */
.notif-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.notif-bar .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.notif-bar .actions form { margin: 0; }
.notif-tabs { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.notif-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 8px; color: var(--muted); font-weight: 600; text-decoration: none; }
.notif-tabs a.is-active { background: var(--brand); color: #fff; }
.notif-tabs a.is-active .badge { background: #fff; color: var(--brand); }
.notif-groups { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ng { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 13px; text-decoration: none; }
.ng:hover { border-color: var(--brand); }
.ng.is-active { border-color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.ng-n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.notif-card { max-width: 900px; }
.notif-day { margin: 14px 0 4px; padding: 0 8px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: none; }
.notif-day:first-child { margin-top: 0; }
/* Настройки уведомлений */
.ns-nav { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; padding: 6px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.ns-nav a { padding: 5px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; }
.ns-nav a:hover { background: var(--surface-2); color: var(--text); }
.channel-pick input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); }
.ns-matrix { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.ns-matrix th, .ns-matrix td { padding: 7px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.ns-matrix thead th { font-size: 13px; color: var(--muted); }
.ns-matrix .ns-col { width: 110px; text-align: center; white-space: nowrap; }
.ns-matrix .ns-col .icon { width: 15px; height: 15px; vertical-align: -2px; }
.ns-matrix input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); }
.ns-group th, .ns-group td { background: var(--surface-2); font-weight: 700; }
.ns-all { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.ns-dnd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 14px; }
.ns-dnd form { margin: 0; }
.ns-quiet { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.ns-quiet label { display: inline-flex; align-items: center; gap: 6px; }
.ns-quiet input[type="time"] { width: auto; min-width: 110px; }
.ns-quiet-on input { width: 18px; height: 18px; accent-color: var(--brand); }
.ns-push-tips { margin: 10px 0 0; padding-left: 18px; }
@media (max-width: 640px) {
    .ns-matrix .ns-col { width: 64px; padding: 6px 4px; font-size: 12px; }
    .ns-matrix .ns-col .icon { display: none; }
    .ns-all span { display: none; }
    .notif-bar { align-items: stretch; }
    .notif-dropdown .dnd-menu { right: -40px; width: min(250px, calc(100vw - 48px)); }
}
/* Открыт колокольчик — облачко Канбанчика не закрывает «Все уведомления · Настроить» (телефон, с. 59) */
body:has(#bell-dropdown:not([hidden])) .helper-bubble { display: none !important; }
@media (max-width: 640px) { .notif-dropdown .notif-list { max-height: calc(100vh - var(--bell-top, 64px) - 190px); } }
@media (max-width: 860px) { .ns-nav { position: static; } }

/* ===== С. 60 — «Профиль и резюме» (интерфейс 13): карточка слева, сведения справа; видимость рядом с полями; файлы к резюме ===== */
.pf-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.pf-side { position: sticky; top: 12px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 22px 18px; }
.pf-ava { margin-bottom: 6px; }
.pf-ava .avatar-framed { margin: 24px; }
.pf-name { font-size: 20px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.pf-id { margin-top: -2px; }
.pf-status { font-size: 14px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); }
.pf-actions { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 10px; }
.pf-actions .btn, .pf-actions form, .pf-actions form .btn { width: 100%; justify-content: center; }
.pf-export { position: relative; width: 100%; }
.pf-export > summary { list-style: none; width: 100%; justify-content: center; }
.pf-export > summary::-webkit-details-marker { display: none; }
.pf-export-menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14); padding: 6px; text-align: left; }
.pf-export-menu a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.pf-export-menu a:hover { background: var(--surface-2); }
.pf-links { display: flex; flex-direction: column; width: 100%; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); text-align: left; }
.pf-links a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; }
.pf-links a:hover { background: var(--surface-2); }
.pf-links .icon { color: var(--muted); flex: none; }
.pf-hint { margin: 8px 0 0; text-align: left; }
.pf-main { min-width: 0; }
.pf-main > .card:first-child { margin-top: 0; }
.pf-sub { font-size: 14px; color: var(--muted); font-weight: 600; margin: 12px 0 4px; }
.pf-sub:first-of-type { margin-top: 0; }
.pf-teams { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pf-teams li { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.pf-teams li.is-hidden { opacity: .72; border-style: dashed; }
.pf-teams .grow { min-width: 0; }
.pf-teams .chip { margin-left: 6px; }
.pf-team-tools { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.pf-team-tools .check { margin: 0; white-space: nowrap; }
.pf-old-awards { margin-top: 10px; }
.pf-old-awards > summary { list-style: none; cursor: pointer; margin-bottom: 8px; }
.pf-old-awards > summary::-webkit-details-marker { display: none; }

/* Настройки профиля */
.pf-savebar { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.pf-savebar .grow { flex: 1; min-width: 200px; }
.pf-dirty { color: var(--danger, #d64545); font-weight: 600; margin-right: auto; }
.pf-edit-head { display: flex; gap: 18px; align-items: flex-start; }
.pf-edit-head .grow { flex: 1; min-width: 0; }
.pf-ava-btn { position: relative; flex: none; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; margin-top: 6px; }
.pf-ava-btn .avatar { display: block; }
.pf-ava-edit { position: absolute; right: 0; bottom: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; box-shadow: 0 0 0 3px var(--surface); }
.pf-ava-btn:hover .avatar { filter: brightness(.92); }
.pf-vis label { color: var(--muted); }
.pf-vis select { background-color: var(--surface-2); }
.pf-vis-check { align-self: end; padding-bottom: 8px; }
.pf-account input:disabled { opacity: .8; }
.pf-ava-dialog { width: min(640px, calc(100vw - 32px)); }
.pf-ava-now { display: flex; gap: 16px; align-items: center; }
.pf-ava-preview { flex: none; }
.pf-ava-preview .avatar { border-radius: 50%; object-fit: cover; }
.pf-ava-drop { flex: 1; min-height: 120px; }
.pf-ava-or { margin: 14px 0 6px; }
.pf-ava-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; max-height: 236px; overflow-y: auto; padding: 2px; }
.pf-ava-grid .avatar-option img { width: 100%; height: auto; aspect-ratio: 1; }

/* Файлы к резюме: миниатюры (во весь экран по щелчку), PDF — карточкой, «×» — удалить */
.resume-files { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.rf-item { position: relative; }
.rf-thumb { display: block; width: 96px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.rf-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rf-doc { display: flex; align-items: center; gap: 8px; height: 72px; max-width: 230px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; }
.rf-doc:hover { border-color: var(--brand); }
.rf-name { font-size: 13px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.rf-del { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; padding: 0; }
.rf-del .icon { width: 12px; height: 12px; }
.rf-del:hover { color: var(--danger, #d64545); border-color: currentColor; }
.rf-drop { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 10px 12px; border: 1.5px dashed var(--border); border-radius: 10px; color: var(--muted); font-size: 14px; cursor: pointer; }
.rf-drop:hover, .rf-drop.is-over { border-color: var(--brand); color: var(--text); background: var(--surface-2); }
.rf-block { margin-top: 12px; }
.rf-summary { margin-top: 2px; }
.resume-list details[open] ~ .rf-summary { display: none; }
.resume-list details > summary .link-btn { display: inline-flex; align-items: center; gap: 6px; }

@media (max-width: 1100px) {
    .pf-layout { grid-template-columns: minmax(0, 1fr); }
    .pf-side { position: static; }
    .pf-actions { flex-direction: row; flex-wrap: wrap; justify-content: center; }
    .pf-actions .btn, .pf-actions form, .pf-export { width: auto; }
}
@media (max-width: 600px) {
    .pf-actions { flex-direction: column; }
    .pf-actions .btn, .pf-actions form, .pf-actions form .btn, .pf-export { width: 100%; }
    .pf-teams li { flex-wrap: wrap; }
    .pf-team-tools { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; flex-wrap: wrap; }
    .pf-edit-head { flex-direction: column; align-items: center; }
    .pf-edit-head .grow { width: 100%; }
    .pf-ava-now { flex-direction: column; }
    .pf-ava-drop { width: 100%; }
    .pf-savebar { position: static; }
}

/* С. 60 (замечание Романа 29.10): на телефоне открытая панель Канбанчика не влезала в экран — не прокручивалась, крестик уходил за верх.
   Теперь открытая панель — лист между верхом экрана и нижними кнопками, прокручивается внутри, крестик всегда виден. */
@media (max-width: 860px) {
    .helper:has(> .helper-panel:not([hidden])), .th:has(> .th-panel:not([hidden])) { z-index: 90; }
    .helper > .helper-panel:not([hidden]), .th > .th-panel:not([hidden]) {
        position: fixed; left: 8px; right: 8px; width: auto;
        top: calc(env(safe-area-inset-top) + 8px);
        bottom: calc(var(--mobilebar-h, 0px) + env(safe-area-inset-bottom) + 8px);
        max-height: none;
    }
    .public-page .helper > .helper-panel:not([hidden]) { bottom: calc(var(--footer-h, 0px) + 8px); }
    .helper:has(> .helper-panel:not([hidden])) > .helper-btn, .th:has(> .th-panel:not([hidden])) > .th-btn { display: none; }
    .helper-panel .helper-body { flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
    .helper-head, .helper-foot { flex: 0 0 auto; }
}
/* Отдельная страница задачи (/tasks/N): свой Канбанчик окна задачи — общий под ним прячем (иначе два помощника в одном углу) */
body:has(main.content [data-th]) .helper[data-helper] { visibility: hidden; }

/* ===== С. 61: «Безопасность» и «Оплаты и чеки» (интерфейс 14) ===== */
.sec-rows { display: flex; flex-direction: column; }
.sec-row { border-top: 1px solid var(--border); }
.sec-row:first-child { border-top: 0; }
.sec-sum { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 12px 0; list-style: none; }
summary.sec-sum { cursor: pointer; }
summary.sec-sum::-webkit-details-marker { display: none; }
.sec-label { font-weight: 600; }
.sec-value { min-width: 0; overflow-wrap: anywhere; }
.sec-note { display: block; }
.sec-edit[open] .sec-btn { background: var(--surface-2); }
.sec-form { max-width: 420px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); margin: 0 0 14px 186px; }
.sec-sum .btn { height: 34px; }
.sec-act { justify-self: end; }
.sec-sessions { list-style: none; margin: 0; padding: 0; }
.sec-sessions li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.sec-sessions li:first-child { border-top: 0; }
.sec-sessions li.is-current .sec-dev { background: var(--ok-soft); color: var(--ok); }
.sec-dev { flex: 0 0 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.sec-filter, .pay-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.sec-filter a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 16px; border: 1px solid var(--border); color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; }
.sec-filter a.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.sec-filter a.is-active .chip { background: rgba(255,255,255,.2); color: #fff; }
.sec-journal tr.is-fail td { background: color-mix(in srgb, var(--danger-soft) 45%, transparent); }
.pay-plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pay-plan { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.pay-plan.is-free { background: var(--surface-2); }
.pay-plan-head { display: flex; align-items: center; gap: 10px; }
.pay-plan-head strong { display: block; line-height: 1.25; overflow-wrap: anywhere; }
.pay-plan-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
.pay-plan-facts dt { color: var(--muted); }
.pay-plan-facts dd { margin: 0; }
.pay-plan .btn { align-self: flex-start; margin-top: auto; }
.pay-table td { white-space: normal; vertical-align: top; }
.pay-table td.nowrap, .pay-table .num { white-space: nowrap; }
.pay-table .num { text-align: right; }
.pay-table tr.is-open td { background: color-mix(in srgb, var(--warn-soft) 40%, transparent); }
.pay-table .chip { white-space: nowrap; }
.pay-team { white-space: normal; }
.pay-table td.pay-docs > a, .pay-table td.pay-docs > span, .pay-table td.pay-docs > details { display: block; line-height: 1.6; }
.pay-acts { display: flex; gap: 6px; margin-top: 6px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 13px; }
.pay-qr summary { cursor: pointer; color: var(--link); display: inline; }
.pay-qr[open] { display: block; margin-top: 6px; }
@media (max-width: 760px) {
    .sec-sum { grid-template-columns: minmax(0, 1fr) auto; }
    .sec-label { grid-column: 1; }
    .sec-value { grid-column: 1 / 3; grid-row: 2; }
    .sec-btn, .sec-act { grid-column: 2; grid-row: 1; justify-self: end; }
    .sec-form { margin-left: 0; max-width: none; }
    /* Журнал входов — строкой-карточкой без подписей; таблицы оплат — карточками с подписями полей */
    .sec-journal thead, .pay-table thead { display: none; }
    .sec-journal, .sec-journal tbody, .pay-table, .pay-table tbody { display: block; }
    .sec-journal tr { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
    .sec-journal td { display: inline; padding: 0; border: 0; }
    .sec-journal td[data-label="Дата"], .sec-journal td[data-label="Время"] { font-weight: 600; }
    .sec-journal td[data-label="Как"]::before { content: '· '; color: var(--muted); }
    .sec-journal td[data-label="Устройство"], .sec-journal td[data-label="IP-адрес"] { color: var(--muted); font-size: 13px; }
    .sec-journal td[data-label="Результат"] { margin-left: auto; }
    .sec-journal tr.is-fail td { background: transparent; }
    .sec-journal tr.is-fail { background: color-mix(in srgb, var(--danger-soft) 45%, transparent); border-radius: 8px; padding-left: 8px; padding-right: 8px; }
    .pay-table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--border); }
    .pay-table td, .pay-table td.pay-docs, .pay-table td.num { display: grid; grid-template-columns: 104px minmax(0, 1fr); column-gap: 8px; padding: 2px 0; border: 0; white-space: normal; text-align: left; }
    .pay-table td::before { content: attr(data-label); grid-column: 1; grid-row: 1 / span 4; color: var(--muted); font-size: 13px; }
    .pay-table td > *, .pay-table td.pay-docs > a, .pay-table td.pay-docs > span, .pay-table td.pay-docs > details { grid-column: 2; display: block; justify-self: start; }
    .pay-table tr.is-open td { background: transparent; }
    .pay-table tr.is-open { background: color-mix(in srgb, var(--warn-soft) 40%, transparent); border-radius: 8px; padding-left: 8px; padding-right: 8px; }
    #sessions .card-head, #plans .card-head { flex-wrap: wrap; }
    #plans .card-head .muted { flex-basis: 100%; }
    .sec-sessions li { flex-wrap: wrap; }
    .sec-sessions li .grow { flex: 1 1 calc(100% - 60px); min-width: 0; }
    .sec-sessions li form { margin-left: 48px; }
    .pay-table td > .pay-acts { display: flex; }
}

/* ===== С. 62: «Коллеги» как 2.1.3 v4 — фильтры сверху, список строками, «Краткая информация» справа ===== */
.col-filters { display: grid; grid-template-columns: minmax(150px, 220px) minmax(150px, 220px) minmax(0, 1fr); gap: 12px 16px; align-items: end; margin-bottom: 8px; }
.col-filters .field { margin: 0; }
.col-filters label { font-weight: 600; }
.col-search { position: relative; }
.col-search input { padding-right: 44px; }
.col-search .btn-icon { position: absolute; right: 4px; bottom: 3px; color: var(--brand); }
:root[data-theme="dark"] .col-search .btn-icon { color: var(--text); }
.col-hint { margin: 0 0 10px; }
.col-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; } /* карточки в две колонки, как было (Роман 29.10) */
.col-list > .col-empty { grid-column: 1 / -1; }
.col-row { display: flex; align-items: flex-start; gap: 14px; padding: 14px 12px 14px 14px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; cursor: pointer; transition: background .12s, border-color .12s; }
.col-row:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.col-row.is-active { background: color-mix(in srgb, var(--brand) 22%, var(--surface)); border-color: color-mix(in srgb, var(--brand) 55%, var(--border)); }
:root[data-theme="standard"] .col-row.is-active { background: #b3b4f7; border-color: #9fa0f2; }
.col-row .avatar-framed, .col-row > .avatar { flex: none; }
.col-row-text { flex: 1; min-width: 0; }
.col-row-name { display: block; font-size: 16px; font-weight: 650; color: var(--link, var(--brand)); overflow-wrap: anywhere; line-height: 1.35; }
:root[data-theme="standard"] .col-row-name { color: #5d5fef; }
:root[data-theme="standard"] .col-row.is-active .col-row-name { color: #26277a; }
.col-row-teams { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.col-row-teams .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:root[data-theme="standard"] .col-row.is-active .chip { background: rgba(255, 255, 255, .55); color: #3d3d55; }
.col-row-name:hover { text-decoration: none; }
.col-row-meta { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
:root[data-theme="standard"] .col-row.is-active .col-row-meta { color: #3d3d55; }
.col-row .fav { flex: none; margin-top: -4px; color: #b4b4bd; }
.col-row .fav .icon { width: 24px; height: 24px; }
.col-row .fav.is-on, .col-brief .fav.is-on { color: #f2b01e; }
.col-row .fav.is-on .icon { fill: currentColor; }
.col-empty { text-align: center; }
.col-more { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 14px 0 4px; flex-wrap: wrap; }
.col-nowrite h2 { margin: 0 0 8px; font-size: 18px; }

/* Правая панель страницы вместо «Моих задач» (layouts/app, @section('rightbar')) */
.rightbar { width: var(--taskbar-w); flex: none; position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h) - var(--footer-h) - var(--banner-h, 0px));
    overflow-y: auto; background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; color: var(--text); }
:root[data-theme="standard"] .rightbar {
    --surface: #3a3a3a; --surface-2: #474747; --text: #f1f1f1; --muted: #b9b9c2; --border: #525252;
    --brand-soft: rgba(255, 255, 255, .12); --link: #b4b5ff; color-scheme: dark; background: var(--surface); border-left-color: #2e2e2e;
}
.rightbar-body { flex: 1; display: flex; flex-direction: column; padding: 20px 18px 92px; } /* внизу — место под Канбанчика: ссылки над ним */
.col-brief { flex: 1; display: flex; flex-direction: column; align-items: stretch; min-height: 100%; }
.col-brief-back { display: none; align-self: flex-start; margin: -8px 0 8px -8px; }
.col-brief-ava { display: flex; justify-content: center; margin: 4px 0 12px; }
.col-brief-name { font-size: 19px; font-weight: 700; text-align: center; overflow-wrap: anywhere; }
.col-brief-status { text-align: center; color: var(--muted); font-size: 14px; margin-top: 4px; }
.col-brief-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; margin: 16px 0 0; font-size: 14px; }
.col-brief-facts dt { color: var(--muted); }
.col-brief-facts dd { margin: 0; overflow-wrap: anywhere; }
.col-brief-facts dd.is-off, .col-brief-facts dd.is-part { color: var(--muted); font-style: italic; display: inline-flex; align-items: center; gap: 6px; }
.col-brief-facts dd .icon { width: 16px; height: 16px; flex: none; }
.col-brief-facts dd.is-none { color: var(--muted); opacity: .75; }
.col-brief-teams { list-style: none; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.col-brief-teams li { display: flex; gap: 10px; align-items: flex-start; }
.col-brief-teams .team-logo { flex: none; border-radius: 6px; }
.col-brief-teams .small { color: var(--muted); }
.col-brief-hidden { color: var(--muted); text-align: center; margin: 14px 0 0; }
.col-brief-links { margin-top: auto; padding-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.col-brief-links a, .col-brief-links .link-btn { display: inline-flex; align-items: center; gap: 10px; color: var(--link); font-size: 14.5px; text-align: left; }
.col-brief-links .icon { width: 18px; height: 18px; color: var(--link); }
.col-brief-links .fav.is-on, .col-brief-links .fav.is-on .icon { color: #f2b01e; }
.col-brief-links form { margin: 0; }
@media (max-width: 1279px) {
    .rightbar { position: fixed; z-index: 45; top: 0; right: 0; bottom: 0; height: auto; width: min(380px, 100vw);
        transform: translateX(105%); transition: transform .2s ease; box-shadow: -8px 0 30px rgba(0, 0, 0, .25); }
    html.rightbar-open .rightbar { transform: none; }
    html.rightbar-open .overlay { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(0, 0, 0, .35); }
    .col-brief-back { display: inline-flex; }
}
@media (max-width: 860px) {
    .app-page .rightbar { bottom: calc(var(--mobilebar-h) + env(safe-area-inset-bottom)); width: 100vw; }
    .col-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .col-search { grid-column: 1 / -1; }
    .col-list { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .col-row { gap: 12px; padding: 10px 10px 10px 12px; }
    .col-row-name { font-size: 15px; }
    .col-hint.is-default { display: none; } /* на телефоне пояснение — у Канбанчика */
}

/* ===== С. 63 (интерфейс 16): «Мои команды», регистрация команды, «О команде» — по 3.1.1–3.1.3 v4 ===== */
.field input[aria-invalid], .field textarea[aria-invalid], .field select[aria-invalid] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.field:has([data-req="all"]) > label::after { content: " *"; color: var(--danger); }
.formal-only .field:has([data-req="formal"]) > label::after { content: " *"; color: var(--danger); }
/* «Мои команды»: поиск, широкая кнопка, карточки */
.tl-search { position: relative; margin-bottom: 12px; }
.tl-search input { width: 100%; height: 44px; padding: 0 44px 0 14px; font: inherit; color: var(--text); background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--brand) 45%, var(--border)); border-radius: 10px; }
.tl-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.tl-search .icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--brand); width: 20px; height: 20px; pointer-events: none; }
:root[data-theme="dark"] .tl-search .icon { color: var(--muted); }
.tl-add { display: flex; align-items: center; gap: 10px; padding: 12px 22px; border-radius: 10px; background: var(--brand); color: var(--brand-text); font-weight: 650; margin-bottom: 16px; }
.tl-add:hover { background: var(--brand-hover); color: var(--brand-text); text-decoration: none; }
.tl-add .icon { width: 18px; height: 18px; }
.tl-list { display: flex; flex-direction: column; gap: 12px; }
.tl-card { display: flex; gap: 18px; align-items: flex-start; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    box-shadow: var(--shadow); cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.tl-card:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.tl-card.is-active { transform: scale(1.015); box-shadow: 0 8px 26px rgba(0, 0, 0, .12); border-color: color-mix(in srgb, var(--brand) 55%, var(--border)); } /* «эффект приближения» 3.1.1.3 v4 */
.tl-card .team-logo { border-radius: 50%; flex: none; }
.tl-text { flex: 1; min-width: 0; }
.tl-name { display: block; font-size: 18px; font-weight: 650; color: var(--link, var(--brand)); overflow-wrap: anywhere; line-height: 1.3; }
.tl-name:hover { text-decoration: none; }
.tl-meta { font-size: 14px; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
.tl-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.tl-none { text-align: center; }
.tl-brief .team-logo { border-radius: 50%; }
.tl-brief .col-brief-name, .team-side-name { font-size: 17px; }
.tl-brief-block { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 14px; }
.tl-brief-h { font-weight: 650; margin-bottom: 6px; }
.tl-brief-person { display: inline-flex; align-items: center; gap: 8px; color: var(--link); }
.tl-brief-person > span { display: flex; flex-direction: column; line-height: 1.3; }
/* Регистрация: форма и «Информация о полях ввода» */
.tc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tc-title { margin: 0; font-size: 20px; color: var(--brand); }
:root[data-theme="dark"] .tc-title { color: var(--text); }
.tc-form .form-actions { flex-wrap: wrap; }
.tc-hints-h { font-weight: 700; font-size: 16px; text-align: center; margin-bottom: 12px; }
.tc-hint { font-size: 14.5px; line-height: 1.5; text-align: center; font-weight: 600; white-space: pre-line; }
.tc-summary { background: color-mix(in srgb, var(--danger) 18%, var(--surface)); border: 1px solid var(--danger); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; font-size: 14px; }
.tc-summary p { margin: 6px 0 4px; }
.tc-summary ul { margin: 0; padding-left: 20px; }
.tc-images { display: flex; flex-wrap: wrap; gap: 14px; }
.tc-image { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; cursor: pointer; border-radius: 12px; }
.tc-image.is-over .btn { border-color: var(--brand); background: var(--brand-soft); }
.tc-image-prev:empty { display: none; }
.tc-image-prev img { display: block; object-fit: cover; border-radius: 10px; }
.tc-image-cover img { width: 260px; height: 90px; }
.tc-image-logo img, .tc-image-logo .team-logo { width: 90px; height: 90px; border-radius: 50%; }
.team-img-drop .tc-image-cover img { width: 100%; max-width: 420px; height: 120px; }
.team-img-drop .tc-image-logo img, .team-img-drop .tc-image-logo .team-logo { width: 120px; height: 120px; }
.team-img-dialog { width: min(520px, calc(100vw - 32px)); }
/* «О команде»: обложка, логотип на ней, главное */
.team-hero { padding: 0; overflow: hidden; }
.team-cover { position: relative; height: 200px; background: linear-gradient(120deg, color-mix(in srgb, var(--brand) 85%, #000) 0%, var(--brand) 55%, color-mix(in srgb, var(--brand) 55%, #fff) 100%); }
:root[data-theme="dark"] .team-cover { background: linear-gradient(120deg, #2a2a2a, #3a3a3a 60%, #4a4a4a); }
.team-cover.has-image { background: var(--surface-2); }
.team-cover-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.team-cam { position: absolute; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; border: 0;
    background: rgba(0, 0, 0, .55); color: #fff; cursor: pointer; }
.team-cam:hover { background: rgba(0, 0, 0, .75); }
.team-cam .icon { width: 20px; height: 20px; }
.team-cam-cover { right: 14px; top: 14px; }
.team-cam-logo { right: 2px; bottom: 2px; }
.team-hero-body { display: flex; gap: 22px; align-items: flex-start; padding: 0 24px 20px; flex-wrap: wrap; }
.team-hero-logo { position: relative; margin-top: -64px; flex: none; }
.team-hero-logo .team-logo { border-radius: 50%; border: 4px solid var(--surface); box-shadow: 0 2px 10px rgba(0, 0, 0, .15); font-size: 46px !important; }
.team-hero-text { flex: 1; min-width: 240px; padding-top: 14px; }
.team-hero-name { font-size: 22px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.team-hero-full { font-size: 16px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.team-hero-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 10px; margin: 12px 0 0; font-size: 14.5px; }
.team-hero-facts dt { font-weight: 600; }
.team-hero-facts dd { margin: 0; overflow-wrap: anywhere; }
.team-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.team-side-open { display: none; }
@media (max-width: 1279px) { .team-side-open { display: inline-flex; } }
.tc-hint-float { margin: -6px 0 4px; padding: 8px 12px; border-radius: 8px; background: var(--brand-soft); font-size: 13.5px; line-height: 1.45; }
@media (min-width: 1280px) { .tc-hint-float { display: none; } }
.team-about h2 { font-size: 16px; margin: 0 0 6px; }
.team-about h2 ~ h2 { margin-top: 16px; }
.team-about p { margin: 0; }
/* «Окно контактных данных» справа */
.team-side-name { font-size: 19px; font-weight: 700; overflow-wrap: anywhere; }
.team-side .col-brief-facts dd.is-warn { color: #ff8a8a; }
.team-side-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.team-side-btns .btn { justify-content: center; }
:root[data-theme="standard"] .rightbar .team-side-btns .btn:not(.btn-primary) { background: #474747; border-color: #5a5a5a; color: #f1f1f1; }
:root[data-theme="standard"] .rightbar .team-side-btns .btn-primary { background: #5d5fef; border-color: #5d5fef; color: #fff; }
.team-side-people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 860px) {
    .tl-card { gap: 12px; padding: 12px; }
    .tl-card .team-logo { width: 56px !important; height: 56px !important; font-size: 22px !important; }
    .tl-card.is-active { transform: none; }
    .tl-name { font-size: 16px; }
    .team-cover { height: 130px; }
    .team-hero-body { padding: 0 14px 14px; gap: 10px; }
    .team-hero-logo { margin-top: -48px; }
    .team-hero-logo .team-logo { width: 96px !important; height: 96px !important; font-size: 36px !important; }
    .team-hero-text { padding-top: 0; min-width: 0; flex-basis: 100%; }
    .team-hero-facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .team-hero-facts dd { margin-bottom: 6px; }
    .tc-image-cover img { width: 200px; height: 70px; }
}

/* С. 63: админка → «Команды» — итоги */
.admin-team-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px 16px; }
.admin-team-stats > div { display: flex; flex-direction: column; }
.admin-team-stats strong { font-size: 22px; line-height: 1.2; }
.admin-team-stats span { font-size: 13px; color: var(--muted); }
.team-img-dialog form + form { margin-top: 10px; }

/* ===== С. 64 (интерфейс 17): «Сведения» — та же форма, что регистрация; блоки ниже сохраняются сразу ===== */
.tc-page { display: flex; flex-direction: column; gap: 16px; }
.tc-page > .card { margin: 0; }
.tc-bar { position: sticky; top: var(--topbar-h); z-index: 5; background: var(--surface); margin: -4px -4px 4px; padding: 6px 4px 10px; border-bottom: 1px solid var(--border); }
.tc-bar-actions { margin-left: auto; display: flex; gap: 8px; }
.tc-block-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.tc-block-head h2 { margin: 0; font-size: 17px; }
.tc-block .list li { align-items: center; }
.tc-block .btn-icon .icon { width: 18px; height: 18px; }
.tc-image-wrap { display: flex; flex-direction: column; gap: 6px; }
.tc-image-prev.is-removed img { opacity: .3; filter: grayscale(1); }
.kind-note { margin: 0; }
@media (max-width: 860px) {
    .tc-bar { position: static; }
    .tc-bar-actions { margin-left: 0; }
    .tc-block .list li { flex-wrap: nowrap; }
    .tc-block .list li > .grow { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
    .tc-block .list li > form { flex: none; margin-left: 0; }
    .tc-block .add-block > summary { white-space: normal; max-width: 100%; text-align: left; }
}

/* С. 65 (интерфейс 18): «Участники» — строка инструментов, таблица «Штатное расписание», окно «Пригласить», карточка участника */
.mb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.mb-search { position: relative; flex: 1 1 150px; max-width: 380px; }
.mb-search input { width: 100%; height: 40px; padding: 0 40px 0 14px; font: inherit; color: var(--text); background: var(--surface);
    border: 1px solid var(--border); border-radius: 999px; }
.mb-search input:focus, .mb-bar select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.mb-search .icon { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.mb-bar select { flex: 0 1 210px; min-width: 0; height: 40px; max-width: 230px; padding: 0 12px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; }
.mb-count { margin: 0; padding: 10px 16px 8px; border-top: 1px solid var(--border); }
.mb-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.mb-actions .btn .chip { margin-left: 4px; }
.mb-more { position: relative; }
.mb-more > summary { list-style: none; }
.mb-more > summary::-webkit-details-marker { display: none; }
.mb-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 250px; padding: 6px; display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0, 0, 0, .15); }
.mb-menu a, .mb-menu .link-btn { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text); text-align: left; font-size: 14px; }
.mb-menu a:hover, .mb-menu .link-btn:hover { background: var(--surface-2); text-decoration: none; }
.mb-menu .link-btn.danger { color: var(--danger); }
.mb-menu .icon { width: 18px; height: 18px; flex: none; }
.mb-card { padding: 4px 0; }
.mb-table { table-layout: fixed; }
.mb-table td { white-space: normal; vertical-align: top; overflow-wrap: anywhere; }
[data-mb-table] th:nth-child(2) { width: 32%; } [data-mb-table] th:nth-child(3) { width: 24%; }
[data-mb-table] th:nth-child(4) { width: 17%; } [data-mb-table] th:nth-child(5) { width: 22%; }
.mb-pending-table th:nth-child(1) { width: 30%; } .mb-pending-table th:nth-child(2) { width: 20%; } .mb-pending-table th:nth-child(3) { width: 20%; }
.mb-pending-table th:nth-child(5) { width: 126px; }
.mb-h { font-size: 16px; margin: 0; padding: 12px 16px 8px; display: flex; align-items: baseline; gap: 8px; }
.mb-h .muted { font-weight: 500; font-size: 14px; }
.mb-group-head th { padding: 14px 10px 6px; text-align: left; font-size: 13px; font-weight: 700; color: var(--text); white-space: normal;
    background: var(--surface-2); border-bottom: 1px solid var(--border); }
.mb-group-head .muted { font-weight: 500; }
.mb-group:first-of-type .mb-group-head th { padding-top: 10px; }
.mb-mail-ico { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--muted); flex: none; }
.mb-mail-ico .icon { width: 16px; height: 16px; }
.mb-acts > div { display: flex; gap: 2px; justify-content: flex-end; }
.mb-acts form { margin: 0; }
.mb-acts .btn.danger .icon { color: var(--danger); }
.mb-pad { padding: 0 16px 12px; margin: 0; }
.mb-newlink { margin: 0 16px 12px; padding: 12px; border-radius: var(--radius); background: var(--brand-soft); display: flex; flex-direction: column; gap: 8px; }
.mb-legacy { margin: 0 16px 12px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: var(--radius); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); }
.mb-legacy .icon { width: 16px; height: 16px; flex: none; }
.mb-legacy .grow { flex: 1 1 300px; }
.mb-pending-table .nowrap { white-space: nowrap; }
.mb-lookup:empty { display: none; }
.mb-lookup { margin-top: 8px; }
.il { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); }
.il .icon { width: 22px; height: 22px; color: var(--muted); flex: none; }
.il-ok { background: color-mix(in srgb, #2e7d32 10%, var(--surface)); }
.il-warn { background: color-mix(in srgb, #f2b01e 16%, var(--surface)); }
.mb-invite-actions { flex-wrap: wrap; }
.mb-newunit { padding: 12px; margin-bottom: 12px; border-radius: var(--radius); background: var(--surface-2); }
.mb-newunit .field:last-child, .mb-newunit .hint { margin-bottom: 0; }
.mb-seat { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin: 4px 0 12px; border-radius: var(--radius);
    background: color-mix(in srgb, #f2b01e 16%, var(--surface)); }
.mb-seat.is-info { background: var(--brand-soft); }
.mb-seat .icon { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.mb-table th button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; white-space: nowrap; }
.mb-table th button:hover { color: var(--text); }
.mb-table th[aria-sort="ascending"] button::after { content: " ▲"; font-size: 9px; }
.mb-table th[aria-sort="descending"] button::after { content: " ▼"; font-size: 9px; }
.mb-table .mb-num { width: 44px; color: var(--muted); text-align: right; }
.mb-row { cursor: pointer; }
.mb-row:hover td { background: var(--surface-2); }
.mb-row.is-active td { background: var(--brand-soft); }
.mb-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.mb-row.is-hidden-member .mb-name a { opacity: .7; }
.mb-pp { display: flex; align-items: center; gap: 10px; }
.mb-pp .avatar { flex: none; }
.mb-table .nowrap { white-space: nowrap; }
.mb-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.mb-name a { font-weight: 600; color: var(--text); }
.mb-contacts { font-size: 13px; }
.mb-contacts a { overflow-wrap: anywhere; }
.mb-contacts .nowrap { white-space: nowrap; }
.mb-none { padding: 14px 16px; margin: 0; }
.mb-invite { width: min(640px, calc(100vw - 32px)); }
.mb-tabs { display: flex; gap: 4px; margin: 4px 0 14px; border-bottom: 1px solid var(--border); overflow-x: auto; overflow-y: hidden; }
.mb-tabs button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; font: inherit; font-weight: 600; color: var(--muted);
    background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.mb-tabs button[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.mb-tabs .icon { width: 18px; height: 18px; }
.mb-sub { font-size: 15px; margin: 16px 0 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.mb-pending { width: min(720px, calc(100vw - 32px)); }
.mc-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 6px; }
.mc-path { color: var(--muted); }
.mc-roles { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 14px; }
.mc-roles > summary { cursor: pointer; color: var(--link); }
.mc-roles .col-brief-facts { margin-top: 8px; }
.mc-act > summary { list-style: none; cursor: pointer; }
.mc-act > summary::-webkit-details-marker { display: none; }
.mc-act .link-btn.danger, .mc-act .link-btn.danger .icon { color: #ff8a80; }
.mc-form { margin-top: 10px; padding: 12px; border-radius: var(--radius); background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.mc-form .field { margin: 0; }
.mc-form select { width: 100%; }
.mc-note { color: var(--muted); margin: 6px 0 0; }
.mc-form .mc-note { margin: 0; }
.mc-roles-pick { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mc-roles-pick legend { color: var(--muted); margin-bottom: 4px; }
.mb-summary .col-brief-hidden { margin-top: 18px; }
@media (max-width: 860px) {
    .mb-search { flex-basis: 100%; max-width: none; }
    .mb-bar select { flex: 1 1 auto; max-width: none; }
    .mb-actions { margin-left: 0; width: 100%; }
    .mb-actions .btn-primary { flex: 1; justify-content: center; }
    /* Таблица — карточками «подпись | значение» (правило с. 21) */
    .mb-table { table-layout: auto; }
    .mb-table thead { display: none; }
    .mb-table, .mb-table tbody, .mb-table tr, .mb-table td { display: block; width: 100%; }
    .mb-table tr { padding: 10px 12px; border-bottom: 1px solid var(--border); }
    .mb-table tr[hidden] { display: none; }
    .mb-table td { border: 0; padding: 2px 0; display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 8px; font-size: 14px; }
    .mb-table td::before { content: attr(data-label); color: var(--muted); font-size: 13px; }
    .mb-table td.mb-num, .mb-table thead { display: none; }
    .mb-table tbody.mb-group[hidden] { display: none; }
    .mb-table .mb-group-head { padding: 0; border: 0; }
    .mb-table .mb-group-head th { display: block; padding: 12px 12px 6px; }
    .mb-table td.mb-acts::before { content: none; }
    .mb-table td.mb-acts { display: block; }
    .mb-table td.mb-person { display: block; padding-bottom: 6px; }
    .mb-table td.mb-person::before { content: none; }
    .mb-pp { min-width: 0; }
}

/* С. 66: «Функциональные обязанности» у сотрудника в оргструктуре и в карточке участника */
.duties { margin-top: 4px; }
.duties > summary { list-style: none; cursor: pointer; }
.duties > summary::-webkit-details-marker { display: none; }
.duties-text { white-space: pre-line; font-size: .875rem; line-height: 1.45; margin-top: 4px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2, rgba(93,95,239,.06)); }

/* С. 66: «Оргструктура» как 3.1.4 v4 — строка инструментов, карандаш и корзина на карточке, «+ Сотрудник» под ней, ветки сворачиваются */
.org-bar .view-switch { flex: none; }
.page-org .org-chart-wrap { margin-top: 0; padding: 28px 20px 32px; }
.org-box-wrap { position: relative; display: flex; }
.org-box { padding-top: 14px; }
.org-box-tools { position: absolute; top: 4px; right: 4px; display: flex; gap: 0; }
.org-box-tools form { display: inline; }
.org-tool { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; flex: none; }
.org-tool .icon { width: 16px; height: 16px; }
.org-tool:hover, .org-tool:focus-visible { background: var(--brand-soft); color: var(--brand); outline: none; }
.org-tool.is-danger:hover { background: rgba(229, 57, 53, .1); color: #e53935; }
.org-box-wrap:has(.org-box-tools) .org-box { padding-left: 36px; padding-right: 36px; }
.org-under { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: -1px; position: relative; z-index: 1; }
.org-fold { display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 6px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); font: inherit; font-size: 11px; cursor: pointer; }
.org-fold .icon { width: 12px; height: 12px; transition: transform .15s; }
.org-fold:hover { color: var(--brand); border-color: var(--brand); }
[data-org-node].is-folded > .org-under .org-fold .icon, [data-org-node].is-folded > .org-card .org-fold .icon { transform: rotate(180deg); }
.org-fold.is-inline { height: 28px; width: 28px; padding: 0; justify-content: center; border-radius: 6px; }
.org-fold.is-inline .icon { width: 16px; height: 16px; }
[data-org-node].is-folded > .org-card .org-fold.is-inline .icon { transform: rotate(-90deg); }
.org-chart li.is-folded > ul, .org-list li.is-folded > .org-list { display: none; }
.org-add { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; border-radius: 6px; }
.org-add .icon { width: 12px; height: 12px; }
.org-add:hover { color: var(--brand); background: var(--brand-soft); }
.org-chart ul { padding-top: 16px; }
.org-print-title { display: none; }
.org-info-modal { width: min(600px, calc(100vw - 32px)); }
.unit-info .list li { align-items: flex-start; }
.org-modal { width: min(640px, calc(100vw - 32px)); }
.org-modal h2 { margin: 0 40px 14px 0; font-size: 20px; }
.org-emp-who { font-weight: 600; margin-bottom: 12px; }
.org-contacts { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px 4px; margin: 12px 0 0; }
.org-contacts legend { padding: 0 6px; font-size: 13px; color: var(--muted); }
.org-phone-row { display: flex; gap: 6px; }
.org-phone-row input:first-child { flex: 1 1 auto; min-width: 0; }
.org-phone-row input:last-child { flex: 0 0 76px; }
.org-modal .form-actions { align-items: center; }
.org-remove { margin-left: auto; }
.org-unit-more { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.org-unit-more form { display: inline; }
.org-unit-more form:last-child { margin-left: auto; }
.org-card-head .org-tools { gap: 0; }
.org-members li { align-items: flex-start; }
.org-loose .list li { align-items: center; }

@media print {
    .page-org .sidebar, .page-org .topbar, .page-org .subnav, .page-org .org-bar, .page-org .org-loose, .page-org .org-under, .page-org .org-box-tools,
    .page-org .helper, .page-org .site-footer, .page-org .mobile-bar, .page-org .test-banner, .page-org .notice, .page-org .taskbar { display: none !important; }
    .page-org .content, .page-org .content-inner { padding: 0 !important; margin: 0 !important; max-width: none !important; background: #fff !important; }
    .page-org .org-chart-wrap { overflow: visible; box-shadow: none; border: 0; padding: 0; }
    .page-org .org-print-title { display: block; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
    .page-org .org-box { box-shadow: none; break-inside: avoid; }
}
@media (max-width: 860px) {
    .org-bar .mb-actions { margin-left: 0; flex-wrap: wrap; width: 100%; gap: 6px; }
    .org-bar .mb-actions .btn:not(.btn-icon) { flex: 1 1 auto; justify-content: center; }
    .org-modal .form-actions { flex-wrap: wrap; }
    .org-remove { margin-left: 0; flex-basis: 100%; text-align: left; }
}

/* С. 66, вторая часть (замечания Романа 31.10): плашки как в СУПРО 4 — аватар наполовину над карточкой (крупнее, 64 px),
   под карточкой подразделения — столбик плашек сотрудников и вакансий, ниже — вложенные подразделения. */
.page-org .org-chart-wrap { display: block; overflow: auto; }
.org-chart ul { padding-top: 20px; }
.org-chart li { padding: 52px 12px 0; }
.org-chart > li { padding-top: 40px; }
.org-plate { position: relative; z-index: 1; width: 214px; padding: 40px 12px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.org-plate.is-unit { border-top: 3px solid var(--brand); }
.org-chart > li > .org-plate.is-unit { border: 2px solid var(--brand); }
.org-plate.is-vacancy { border-style: dashed; background: var(--surface-2); box-shadow: none; }
.org-ava { position: absolute; top: -32px; left: 50%; transform: translateX(-50%); display: grid; place-items: center; width: 64px; height: 64px; }
.org-ava .avatar { box-shadow: 0 0 0 3px var(--surface); border-radius: 50%; }
.org-ava-empty { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--surface-2); color: var(--muted); box-shadow: 0 0 0 3px var(--surface); border: 1px solid var(--border); }
.org-ava-empty .icon { width: 30px; height: 30px; }
.org-plate-body { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 13px; line-height: 1.3; cursor: pointer; text-align: center; }
button.org-plate-body:hover .org-name, button.org-plate-body:hover .org-title { color: var(--brand); }
.org-title { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.org-name { font-weight: 600; }
.org-pos { color: var(--muted); font-size: 12.5px; }
.org-count { color: var(--muted); font-size: 12px; margin-top: 4px; }
.org-vac { font-weight: 700; letter-spacing: .08em; color: #e0663a; font-size: 13px; }
.org-plate-tools { position: absolute; top: 4px; right: 4px; display: flex; }
.org-plate-tools form { display: inline; }
.org-plate .org-plate-tools ~ .org-plate-body, .org-plate:has(.org-plate-tools) .org-plate-body { padding: 0 6px; }
.org-under { position: relative; padding: 4px 0 0; }
.org-under::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 1px solid var(--border); z-index: 0; }
.org-under > * { position: relative; z-index: 1; }
.org-add { background: var(--surface); }
.org-branch { display: flex; flex-direction: column; align-items: center; }
.org-staff { position: relative; display: flex; flex-direction: column; align-items: center; gap: 44px; padding-top: 44px; }
.org-staff::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 1px solid var(--border); }
.org-branch:has(> ul) > .org-staff { padding-bottom: 20px; }
.org-staff .org-plate { width: 200px; }
.org-chart li.is-folded > .org-branch { display: none; }
.org-pi-head { display: flex; align-items: center; gap: 12px; margin: 6px 40px 10px 0; }
.org-pi-head h2 { margin: 0 0 2px; font-size: 18px; }
.org-pi-h { font-size: 14px; margin: 14px 0 6px; }
.org-remove { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; margin-left: auto; }
@media print { .page-org .org-plate-tools { display: none !important; } .page-org .org-plate { box-shadow: none; break-inside: avoid; } }
/* схема — на всю ширину рабочей области при любом разрешении (замечание Романа 31.10) */
:root .page-org .content-inner { max-width: none; }
.org-plate { padding-top: 44px; }

/* С. 66, третья часть (решение Романа 31.10): одна карточка — одна должность, у всех карточек одинаковые кнопки */
.org-plate.is-top { border: 2px solid var(--brand); }
.org-plate.is-vacancy .org-title { color: var(--muted); }
.org-plate .org-title { display: block; }
.org-ava-empty.is-sm { width: 56px; height: 56px; flex: none; box-shadow: none; }
.org-invite { margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; }
.org-invite > summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; color: var(--brand); list-style: none; }
.org-invite > summary::-webkit-details-marker { display: none; }
.org-invite[open] > summary { margin-bottom: 10px; }
.org-invite-note { margin-top: 10px; }
.org-unit-danger { margin-left: auto; display: inline-flex; flex-wrap: wrap; gap: 6px 16px; }
.org-unit-danger form { display: inline; }
.org-unit-more form:last-child { margin-left: 0; }
/* подчинённые без своих подчинённых — столбиком под руководителем (как в СУПРО 4), схема не расползается вширь */
.org-chart ul.org-col { flex-direction: column; align-items: center; padding-top: 0; }
.org-chart ul.org-col::before { height: auto; top: 0; bottom: 60px; }
.org-chart ul.org-col > li { padding: 44px 0 0; }
.org-chart ul.org-col > li::before, .org-chart ul.org-col > li::after { display: none; }
.org-chart ul.org-col > li > .org-plate { width: 200px; }
/* линии подчинения — заметнее (как в СУПРО 4: фирменный цвет) */
.page-org { --org-line: color-mix(in srgb, var(--brand) 55%, #9a9ab0); }
.page-org .org-chart ul::before, .page-org .org-chart ul > li::before, .page-org .org-chart ul > li::after,
.page-org .org-under::before { border-color: var(--org-line); }
/* с. 66: «Левее / Правее» убраны (просьба Романа) — внизу окна только «Освободить» и «Удалить» */
.org-unit-more { justify-content: flex-end; }


/* Роли (с. 67, интерфейс 20): таблица «участник × раздел» по отделам, сохранение сразу, массовое назначение */
.rl-note { display: flex; align-items: center; gap: 8px; margin: -4px 0 10px; }
.rl-note .icon { width: 16px; height: 16px; flex: none; }
.rl-wrap { overflow: visible; }
.rl-table { table-layout: fixed; width: 100%; }
.rl-table th, .rl-table td { white-space: normal; vertical-align: middle; padding: 6px 8px; }
.rl-table thead th { position: sticky; top: var(--topbar-h); z-index: 3; background: var(--surface); box-shadow: inset 0 -1px 0 var(--border); }
.rl-table .rl-check { width: 40px; text-align: center; }
.rl-table .mb-num { width: 34px; }
.rl-table .rl-person-h { width: 19%; }
.rl-table .rl-pos-h { width: 13%; }
.rl-table td.rl-cell, .rl-table th.rl-mod-h { padding-left: 4px; padding-right: 4px; }
.rl-table .rl-mod-h { text-align: left; }
.rl-check input, .rl-group-check input { width: 17px; height: 17px; cursor: pointer; accent-color: var(--brand); }
.rl-group-check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.rl-table .mb-group-head th { position: static; box-shadow: none; }
.rl-person .mb-name a { font-weight: 600; color: var(--text); }
.rl-pos { font-size: 13px; overflow-wrap: anywhere; }
.rl-cell .role-select { width: 100%; min-width: 0; max-width: none; height: 34px; cursor: pointer; padding: 0 16px 0 6px; text-overflow: ellipsis; font-size: 13px;
    -webkit-appearance: none; appearance: none; background-repeat: no-repeat; background-position: right 5px center; background-size: 9px 6px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238a8a8a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.rl-cell .role-select:hover { border-color: var(--brand); }
.rl-cell { transition: background-color .3s; }
.rl-cell.is-busy .role-select { opacity: .6; }
.rl-cell.is-saved { animation: rl-saved 1.8s ease; }
.rl-cell.is-failed { animation: rl-failed 1.8s ease; }
@keyframes rl-saved { 0%, 40% { background: color-mix(in srgb, #2e7d32 22%, var(--surface)); } 100% { background: transparent; } }
@keyframes rl-failed { 0%, 50% { background: color-mix(in srgb, #d32f2f 22%, var(--surface)); } 100% { background: transparent; } }
.rl-row.is-me td { background: var(--surface-2); }
.rl-row.is-picked td { background: var(--brand-soft); }
.rl-row.is-target td { background: color-mix(in srgb, #f2b01e 22%, var(--surface)); transition: background-color 1s; }
.rl-row.is-head .role-badge { font-weight: 700; }
.rl-noscript { padding: 0 16px 12px; }
.rl-bulk { position: fixed; z-index: 40; left: 50%; transform: translate(-50%, 140%); bottom: calc(var(--footer-h, 0px) + 18px);
    display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; padding: 10px 14px; max-width: calc(100vw - 32px); white-space: nowrap;
    background: var(--surface); border: 1px solid var(--border); border-radius: 999px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
    opacity: 0; pointer-events: none; transition: transform .2s, opacity .2s; }
.rl-bulk.is-on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.rl-bulk select { height: 36px; padding: 0 10px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; max-width: 220px; }
.rl-bulk-count { white-space: nowrap; }
.rl-toast { position: fixed; z-index: 60; left: 50%; top: calc(var(--topbar-h) + 12px); transform: translate(-50%, -20px); max-width: min(560px, calc(100vw - 32px));
    padding: 10px 16px; border-radius: var(--radius); background: #2e7d32; color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
    opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; font-size: 14px; }
.rl-toast.is-bad { background: #c62828; }
.rl-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.rl-help { width: min(1000px, calc(100vw - 32px)); }
.rl-help h2 { margin-top: 0; }
.rl-guide { font-size: 13px; }
.rl-guide th, .rl-guide td { white-space: normal; vertical-align: top; padding: 6px 8px; }
.rl-guide thead th { position: sticky; top: -20px; background: var(--surface); z-index: 1; }
.rl-guide thead th:first-child { width: 34%; }
.rl-guide-sec th { text-align: left; font-weight: 700; background: var(--surface-2); }
.rl-guide .rl-yes { color: #2e7d32; }
.rl-guide .rl-yes .icon { width: 16px; height: 16px; }
.rl-guide .rl-no { color: var(--muted); }
@media (max-width: 1100px) and (min-width: 861px) {
    .rl-wrap { overflow-x: auto; }
    .rl-table { min-width: 860px; }
    .rl-table thead th { position: static; }
}
@media (max-width: 860px) {
    /* Телефон — карточки по людям, как в v4: подпись раздела слева, роль справа */
    .rl-table, .rl-table tbody, .rl-table tr, .rl-table td { display: block; width: 100%; }
    .rl-table thead { display: none; }
    .rl-table tr.rl-row { position: relative; padding: 10px 12px; border-bottom: 1px solid var(--border); }
    .rl-table tr[hidden], .rl-table tbody.mb-group[hidden] { display: none; }
    .rl-table td { border: 0; padding: 3px 0; }
    .rl-table td.mb-num { display: none; }
    .rl-table td.rl-check { position: absolute; right: 12px; top: 14px; width: auto; padding: 0; }
    .rl-table td.rl-person { padding-right: 34px; }
    .rl-table td.rl-pos { padding-left: 42px; color: var(--muted); }
    .rl-table td.rl-cell { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 8px; }
    .rl-table td.rl-cell::before { content: attr(data-label); color: var(--muted); font-size: 13px; }
    .rl-table .mb-group-head th { display: block; padding: 12px 12px 6px; }
    .rl-bulk { flex-wrap: wrap; white-space: normal; border-radius: var(--radius); left: 12px; right: 12px; transform: translateY(140%); max-width: none;
        bottom: calc(var(--mobilebar-h, 56px) + 10px + env(safe-area-inset-bottom)); }
    .rl-bulk.is-on { transform: none; }
    body.rl-bulk-on .helper { visibility: hidden; }
    .rl-bulk select { flex: 1 1 140px; max-width: none; }
    .rl-guide thead { display: none; }
    .rl-guide, .rl-guide tbody, .rl-guide tr, .rl-guide td, .rl-guide th { display: block; width: 100%; }
    .rl-guide tr { padding: 6px 0; border-bottom: 1px solid var(--border); }
    .rl-guide td { border: 0; padding: 2px 8px; }
    .rl-guide td:first-child { font-weight: 600; }
    .rl-guide td[data-label] { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px; }
    .rl-guide td[data-label]::before { content: attr(data-label); color: var(--muted); }
}

/* ——— С. 68 (интерфейс 21): вкладка «Тариф», «Хранилище команды», «Наши продукты» ——— */
.bl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; align-items: start; margin-bottom: 16px; }
.bl-card { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.bl-card p { margin: 0; }
.bl-h { font-size: 15px; font-weight: 700; margin: 0 0 6px; }
.bl-plan { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bl-chip { display: inline-block; padding: 4px 12px; border-radius: 999px; font-weight: 700; font-size: 16px; background: var(--brand); color: #fff; }
.bl-chip.is-free { background: var(--surface-2, #eef0f4); color: var(--text); border: 1px solid var(--border); }
.bl-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 8px; }
.bl-usage { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14px; }
.bl-usage li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: baseline; }
.bl-usage li > span { color: var(--muted); }
.bl-usage .bl-bar, .bl-usage small, .bl-usage .bl-link { grid-column: 1 / -1; }
.bl-bar { display: block; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.bl-bar > i { display: block; height: 100%; background: var(--ok, #2e7d32); border-radius: 3px; }
.bl-bar > i.is-warn { background: var(--warn, #ef8f00); }
.bl-bar > i.is-over { background: var(--danger); }
.bl-link { font-size: 13px; }
.bl-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 10px; overflow-x: auto; overflow-y: hidden; }
.bl-tabs button { border: 0; background: none; font: inherit; font-size: 14px; color: var(--muted); padding: 6px 10px; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.bl-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--brand); font-weight: 600; }
.bl-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 6px; }
.bl-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.bl-form input[type=number], .bl-form input[type=email], .bl-form select { height: 38px; padding: 0 10px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; width: 130px; }
.bl-form input[type=email] { width: 100%; }
.bl-form select[name=seats], .bl-form select[name=gb] { width: 240px; max-width: 100%; }
.bl-wide { flex-basis: 100%; }
.bl-what { flex-basis: 100%; font-weight: 600; }
.bl-sum { flex-basis: 100%; font-size: 18px; }
.bl-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.bl-seg label { flex-direction: row; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--text); font-size: 14px; cursor: pointer; }
.bl-seg label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.bl-fields { display: flex; flex-wrap: wrap; gap: 10px; }
.bl-fields[hidden] { display: none; }
.bl-over { font-weight: 500; }
.bl-history summary { cursor: pointer; margin: 0; }
.bl-history[open] summary { margin-bottom: 8px; }
@media (max-width: 640px) {
    .bl-table thead { display: none; }
    .bl-table tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--border); }
    .bl-table td { display: block; position: relative; padding: 2px 0 2px 112px; border: 0; white-space: normal; }
    .bl-table td::before { content: attr(data-label); position: absolute; left: 0; top: 3px; width: 104px; color: var(--muted); font-size: 13px; }
}

/* Хранилище команды */
.st-sum { margin-bottom: 12px; }
.st-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 10px; }
.st-total { font-size: 20px; }
.st-pct { font-weight: 700; color: var(--ok, #2e7d32); }
.st-pct.is-warn { color: var(--warn, #ef8f00); }
.st-pct.is-over { color: var(--danger); }
.st-buy { margin-left: auto; }
.st-bar { display: flex; height: 12px; border-radius: 6px; background: var(--border); overflow: hidden; gap: 2px; }
.st-bar i { display: block; height: 100%; }
.st-tasks { background: var(--brand); }
.st-docs { background: #2a9d8f; }
.st-trash { background: #e76f51; }
.st-other { background: #9aa0a6; }
.st-legend { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }
.st-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.st-boards { margin-top: 10px; font-size: 14px; }
.st-boards summary { cursor: pointer; color: var(--muted); }
.st-boards ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.st-boards li { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.st-num { margin-left: auto; color: var(--muted); }
.st-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; font-size: 11px; background: var(--border); color: var(--muted); }
.st-table td, .st-table th { vertical-align: top; }
.st-check { width: 34px; }
.st-r { text-align: right; }
.st-actions { position: sticky; bottom: calc(var(--footer-h, 0px) + 8px); z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px;
    padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 6px 20px rgba(0, 0, 0, .12); }
.st-actions > span { margin-right: auto; }
.st-actions[hidden] { display: none; }
@media (max-width: 640px) {
    .st-buy { margin-left: 0; }
    .st-table thead { display: none; }
    .st-table tr { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 2px 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
    .st-table td { display: block; padding: 0; border: 0; white-space: normal; overflow-wrap: anywhere; min-width: 0; }
    .st-table { table-layout: fixed; width: 100%; }
    .st-table td.st-check { grid-row: span 4; }
    .st-table td.st-r { text-align: left; }
    .st-actions { position: fixed; left: 12px; right: 12px; z-index: 43; bottom: calc(var(--mobilebar-h, 56px) + 10px + env(safe-area-inset-bottom)); }
}

/* «Наши продукты» (1.1.9 v.5) */
.pr { max-width: 1240px; margin: 0 auto; }
.pr-head { text-align: center; margin: 8px auto 20px; max-width: 820px; }
.pr-title { font-size: clamp(22px, 3vw, 30px); line-height: 1.2; margin: 0 0 10px; }
.pr-lead { color: var(--muted); margin: 0 0 16px; }
.pr-period { display: inline-flex; padding: 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); gap: 4px; }
.pr-period button { border: 0; background: none; font: inherit; padding: 8px 16px; border-radius: 999px; cursor: pointer; color: var(--text); }
.pr-period button[aria-checked="true"] { background: var(--brand); color: #fff; }
.pr-period button[aria-checked="true"] .pr-save { color: #fff; }
.pr-save { color: var(--ok, #2e7d32); font-size: 13px; }
.pr-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
@media (max-width: 1100px) { .pr-plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) { .pr-plans { grid-template-columns: minmax(0, 1fr); } }
.pr-plan { position: relative; display: flex; flex-direction: column; gap: 6px; margin: 0; padding-top: 22px; }
.pr-plan h2 { margin: 0; font-size: 22px; }
.pr-plan p { margin: 0; }
.pr-main { border: 2px solid var(--brand); }
.pr-badge { position: absolute; top: -12px; left: 20px; padding: 2px 10px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 600; }
.pr-stamp { position: absolute; top: 14px; right: 14px; width: 74px; height: 74px; border: 2px solid var(--ok, #2e7d32); border-radius: 50%; color: var(--ok, #2e7d32);
    display: flex; align-items: center; justify-content: center; text-align: center; font-size: 11px; font-weight: 700; line-height: 1.15; transform: rotate(-12deg); }
.pr-for { color: var(--muted); font-size: 14px; padding-right: 80px; }
.pr-main .pr-for, .pr-plan:not(:has(.pr-stamp)) .pr-for { padding-right: 0; }
.pr-price { font-size: 30px; font-weight: 700; margin-top: 6px !important; }
.pr-price small { font-size: 14px; font-weight: 400; color: var(--muted); }
.pr-sub { font-size: 13px; color: var(--muted); }
.pr-calc { margin: 8px 0 0; display: grid; gap: 6px; font-size: 14px; }
.pr-label, .pr-calc > label { color: var(--muted); font-size: 13px; }
.pr-stepper { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; width: max-content; }
.pr-stepper button { border: 0; background: var(--surface-2, #f1f2f6); width: 38px; height: 38px; font-size: 18px; cursor: pointer; color: var(--text); }
.pr-stepper input { width: 70px; height: 38px; border: 0; text-align: center; font: inherit; font-weight: 600; background: var(--surface); color: var(--text); }
.pr-stepper input.is-invalid { box-shadow: inset 0 0 0 2px var(--danger); }
.pr-err { color: var(--danger); font-size: 13px; }
.pr-hint { color: var(--muted); font-size: 13px; }
.pr-total { font-weight: 600; }
.pr-seg { display: inline-flex; gap: 4px; }
.pr-seg button { border: 1px solid var(--border); background: var(--surface); padding: 6px 14px; border-radius: 999px; font: inherit; cursor: pointer; color: var(--text); }
.pr-seg button[aria-checked="true"] { border-color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.pr-list { list-style: none; margin: 10px 0 12px; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.pr-list li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 6px; }
.pr-list li.is-off { color: var(--muted); }
.pr-yes { color: var(--ok, #2e7d32); font-weight: 700; }
.pr-no { color: var(--muted); }
.pr-btn { margin-top: auto; width: 100%; justify-content: center; }
.pr-offer { font-size: 13px; text-align: center; }
.pr-more { font-size: 13px; text-align: center; color: var(--muted); }
.pr-trial { text-align: center; margin: 14px 0 20px; font-weight: 500; }
.pr-h2 { font-size: 18px; margin: 0 0 10px; }
.pr-table-card { margin-bottom: 20px; }
.pr-table th:not(:first-child), .pr-table td:not(:first-child) { text-align: center; }
.pr-table .pr-group th { text-align: left; background: var(--surface-2, #f5f6f9); font-size: 13px; color: var(--muted); }
@media (max-width: 680px) { .pr-table { min-width: 560px; } }
.pr-faq { margin-bottom: 20px; }
.pr-faq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 820px) { .pr-faq-grid { grid-template-columns: minmax(0, 1fr); } }
.pr-faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; }
.pr-faq summary { cursor: pointer; font-weight: 600; }
.pr-faq details p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.pr-mine { margin-bottom: 20px; }
.pr-modal { width: min(480px, calc(100vw - 32px)); }
.pr-modal h2 { margin: 0 32px 6px 0; font-size: 18px; }
.pr-modal-sum { font-weight: 600; margin: 0 0 12px; }
.pr-modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pr-field { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; border: 0; padding: 0; font-size: 14px; }
.pr-field legend { font-size: 13px; color: var(--muted); margin-bottom: 4px; padding: 0; }
.pr-field select { height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; font: inherit; background: var(--surface); color: var(--text); }
.pr-field label { display: flex; gap: 8px; align-items: center; }
.pr-go [hidden] { display: none !important; }
.inv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.inv-title { font-size: 18px; }
/* Канбанчик не закрывает кнопки панели действий (правило с. 57) */
.st-actions { padding-right: 100px; }
@media (max-width: 640px) { .st-actions { padding-right: 76px; } }

/* ===== С. 69: администрирование (интерфейс 22) ===== */
:root .page-admin .content-inner { max-width: none; }
.adm-nav { margin-top: 0; }
.adm-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.adm-head h2 { margin: 0 0 2px; }
.adm-head .grow { flex: 1; min-width: 220px; }
.adm-head .chips { margin: 6px 0 4px; }
.adm-filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.adm-filter .field { flex: 1 1 180px; min-width: 0; margin: 0; }
.adm-filter .field.grow-2 { flex: 2 1 280px; }
.adm-filter .form-actions { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.adm-filter .inline-form { display: flex; gap: 6px; flex-wrap: nowrap; }
.adm-filter .inline-form > * { min-width: 0; }
.adm-num { width: 90px; }
.adm-mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; word-break: break-all; }
.adm-subnav { border-bottom: 0; margin-bottom: 0; }
.adm-subnav a { border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; margin: 0; }
.adm-subnav a.is-active { border-color: var(--brand); background: var(--brand-soft); color: var(--text); }
.adm-subnav .badge { margin-left: 4px; }
.adm-pay-top { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.adm-pay-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.adm-pop { position: relative; }
.adm-pop > summary { list-style: none; cursor: pointer; }
.adm-pop > summary::-webkit-details-marker { display: none; }
.adm-pop-body { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: min(360px, 90vw); padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14); display: grid; gap: 10px; }
.adm-pop-body p { margin: 0; }
.adm-sort { color: inherit; white-space: nowrap; }
.adm-sort.is-on { color: var(--brand); }
.adm-row-actions { white-space: nowrap; }
.adm-row-actions form { display: inline-flex; margin: 0 0 4px; gap: 4px; align-items: center; }
.adm-row-actions .btn-icon { width: 32px; height: 32px; }
.adm-row-actions .danger, .adm-row-actions .danger svg { color: var(--danger); }
.adm-row-ok td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
.adm-row-off { opacity: .6; }
.adm-money { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.adm-money a { display: flex; flex-direction: column; color: var(--text); padding: 4px 0; }
.adm-money a:hover { text-decoration: none; }
.adm-money strong { font-size: 22px; line-height: 1.2; }
.adm-money span { font-size: 13px; color: var(--muted); }
.adm-money a.is-warn strong { color: var(--warn, #ef8f00); }
.adm-deleted { border-left: 4px solid var(--danger); }
.adm-deleted p { margin-top: 0; }
.adm-billing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 10px 0; align-items: start; }
.adm-act { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.adm-act > summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; list-style: none; }
.adm-act > summary::-webkit-details-marker { display: none; }
.adm-act[open] > summary { margin-bottom: 8px; }
.adm-act .inline-form { display: flex; gap: 6px; }
.adm-act .inline-form input { min-width: 0; flex: 1; }
@media (max-width: 860px) {
    .adm-table thead { display: none; }
    .adm-table, .adm-table tbody { display: block; }
    .adm-table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--border); }
    .adm-table td { display: block; position: relative; padding: 2px 0 2px 120px; border: 0; white-space: normal; min-height: 22px; }
    .adm-table td::before { content: attr(data-label); position: absolute; left: 0; top: 3px; width: 112px; color: var(--muted); font-size: 13px; }
    .adm-table td:not([data-label]) { padding: 6px 0 0; }
    .adm-table td:not([data-label])::before { content: none; }
    .adm-table td[colspan] { display: block; }
    .adm-row-actions { white-space: normal; display: flex !important; flex-wrap: wrap; gap: 6px; }
    .adm-row-ok td:first-child { box-shadow: none; }
    .adm-row-ok { box-shadow: inset 3px 0 0 var(--ok); padding-left: 8px !important; }
    .adm-pop-body { position: fixed; left: 16px; right: 16px; top: auto; bottom: calc(var(--mobilebar-h, 56px) + 12px); width: auto; }
    .adm-filter .field, .adm-filter .field.grow-2 { flex-basis: 100%; }
}

/* «Сведения»: удаление команды (с. 69) */
.tc-danger { border-color: var(--danger-soft); }
.tc-danger-sum { cursor: pointer; color: var(--danger); font-weight: 600; display: inline-flex; align-items: center; gap: 8px; list-style: none; }
.tc-danger-sum::-webkit-details-marker { display: none; }
.tc-danger details[open] .tc-danger-sum { margin-bottom: 8px; }
.tc-danger-list { margin: 4px 0 10px; padding-left: 20px; }
.tc-danger-form { max-width: 520px; }
.notice-warn { background: var(--warn-soft); color: var(--text); border-left: 4px solid var(--warn, #ef8f00); }
.notice-warn ul { margin: 6px 0; padding-left: 20px; }
.tl-deleted .list li { display: flex; align-items: center; gap: 12px; }
.tl-deleted .list form { margin: 0; }
.adm-members > summary { cursor: pointer; list-style: none; }
.adm-members > summary::-webkit-details-marker { display: none; }
.adm-members > summary h2::after { content: ' ▾'; color: var(--muted); font-size: 14px; }
.adm-members:not([open]) > summary { margin-bottom: 0; }

/* «Метрики» (с. 69) */
.mt-funnel { display: grid; gap: 8px; }
.mt-step { display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr) 70px; gap: 12px; align-items: center; }
.mt-step-label { display: flex; flex-direction: column; line-height: 1.25; }
.mt-step-label .small { font-size: 12px; }
.mt-bar { position: relative; height: 30px; background: var(--border); border-radius: 6px; overflow: hidden; }
.mt-bar i { position: absolute; inset: 0 auto 0 0; background: var(--brand); opacity: .85; border-radius: 6px; }
.mt-bar span { position: relative; z-index: 1; display: block; padding: 5px 10px; font-weight: 700; color: var(--text); mix-blend-mode: normal; }
.mt-conv { color: var(--muted); text-align: right; }
.mt-days { display: flex; align-items: flex-end; gap: 3px; height: 170px; padding-top: 18px; overflow-x: auto; }
.mt-day { flex: 1 0 14px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.mt-day i { display: block; width: 100%; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 0; }
.mt-day-reg { font-size: 11px; font-weight: 700; color: var(--ok); min-height: 14px; }
.mt-day-d { font-size: 10px; color: var(--muted); margin-top: 2px; }
.mt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.mt-list li { display: flex; gap: 10px; align-items: baseline; }
.mt-list .grow { min-width: 0; overflow-wrap: anywhere; }
.mt-kpi { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.mt-kpi > div { display: flex; flex-direction: column; }
.mt-kpi strong { font-size: 20px; line-height: 1.2; }
.mt-kpi span { font-size: 13px; color: var(--muted); }
.mt-utm { margin: 10px 0; }
.mt-utm-out { display: flex; gap: 8px; }
.mt-utm-out input { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
@media (max-width: 860px) {
    .mt-step { grid-template-columns: minmax(0, 1fr) 56px; }
    .mt-step-label { grid-column: 1 / -1; }
}

/* Согласие на cookie (с. 69) — над подвалом гостевых страниц */
.cookie-bar { position: fixed; left: 16px; right: 16px; bottom: calc(var(--footer-h, 48px) + 12px); z-index: 70; max-width: 860px; margin: 0 auto;
    display: flex; gap: 12px 20px; align-items: center; flex-wrap: wrap; padding: 14px 16px; background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.cookie-bar p { margin: 0; flex: 1 1 360px; font-size: 14px; }
.cookie-bar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cookie-bar[hidden] { display: none; }
/* с. 70д: плашка и у вошедших — на телефоне над нижними кнопками; текущий выбор — мелко */
.cookie-bar-now { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.app-page .cookie-bar { bottom: calc(var(--footer-h, 46px) + var(--mobilebar-h, 0px) + 12px + env(safe-area-inset-bottom)); }
@media (max-width: 640px) { .cookie-bar { bottom: 12px; left: 8px; right: 8px; padding: 12px; } .cookie-bar p { font-size: 13px; } .cookie-bar-actions { width: 100%; } .cookie-bar-actions .btn { flex: 1; } .app-page .cookie-bar { bottom: calc(var(--mobilebar-h, 0px) + 8px + env(safe-area-inset-bottom)); } }
.mt-heard { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px 24px; }
.mt-heard-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.mt-heard-head span { color: var(--muted); font-size: 13px; }
.mt-heard-row { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr) 90px; gap: 8px; align-items: center; margin: 3px 0; }
.mt-heard-label { font-size: 13px; line-height: 1.2; }
.mt-bar-sm { height: 22px; }
.mt-bar-sm span { padding: 2px 8px; font-size: 13px; }
.mt-heard-paid { color: var(--ok); text-align: right; }
@media (max-width: 640px) { .mt-heard { grid-template-columns: minmax(0, 1fr); } .mt-heard-row { grid-template-columns: minmax(0, 1fr) 70px; } .mt-heard-row .mt-bar { grid-column: 1 / -1; grid-row: 2; } }

/* ===== С. 70: Техподдержка (интерфейс 23) — переписка «как в «Общении»», мои обращения, админка ===== */
.page-support, .sp-admin { --sp-mine: color-mix(in srgb, var(--brand) 12%, var(--surface)); --sp-wall: color-mix(in srgb, var(--brand) 4%, var(--bg)); --sp-accent: var(--brand); }
:root[data-theme="standard"] .page-support, :root[data-theme="standard"] .sp-admin { --sp-mine: #e6e6fd; --sp-wall: #eef0f8; --sp-accent: #5d5fef; }
:root[data-theme="light"] .page-support, :root[data-theme="light"] .sp-admin { --sp-mine: #e9f4df; --sp-wall: #f2f3f5; --sp-accent: #2f7de1; }
:root[data-theme="dark"] .page-support, :root[data-theme="dark"] .sp-admin { --sp-mine: #2b3a52; --sp-wall: #161616; --sp-accent: #8ab4ff; }

.sp-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.sp-side { padding: 0; overflow: hidden; position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100vh - var(--topbar-h) - var(--footer-h) - 32px); display: flex; flex-direction: column; }
.sp-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.sp-side-head strong { white-space: nowrap; }
.sp-side-head .btn { height: 32px; padding: 0 10px; white-space: nowrap; }
.sp-empty { padding: 14px; margin: 0; }
.sp-items { list-style: none; margin: 0; padding: 6px; overflow-y: auto; scrollbar-width: thin; }
.sp-item { display: grid; gap: 3px; padding: 9px 10px; border-radius: var(--radius); color: var(--text); text-decoration: none; }
.sp-item:hover { background: var(--surface-2); text-decoration: none; }
.sp-item.is-active { background: var(--sp-mine, var(--brand-soft)); box-shadow: inset 3px 0 0 var(--sp-accent, var(--brand)); }
.sp-item-top { display: flex; align-items: flex-start; gap: 8px; }
.sp-item-title { flex: 1; min-width: 0; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-item.is-new .sp-item-title { font-weight: 700; }
.sp-dot { flex: none; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sp-item-last { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-item-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sp-item-meta .chip { font-size: 11px; padding: 1px 8px; }

.sp-main { padding: 0; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.sp-main > .notice { margin: 12px 14px 0; }
.sp-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.sp-head .grow { min-width: 0; }
.sp-head-title { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.sp-back { display: none; }
.sp-scroll { background: var(--sp-wall); overflow-y: auto; scrollbar-width: thin; min-height: 260px; max-height: calc(100vh - var(--topbar-h) - var(--footer-h) - 290px); }
.sp-thread { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 18px; }
.sp-day { text-align: center; margin: 6px 0 2px; }
.sp-day span { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 12px; box-shadow: 0 1px 1.5px rgba(0, 0, 0, .08); }
.sp-msg { display: flex; gap: 8px; align-items: flex-end; max-width: min(720px, 88%); align-self: flex-start; scroll-margin-top: 20px; }
.sp-msg.is-mine { align-self: flex-end; flex-direction: row-reverse; }
.sp-ava .avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.sp-bubble { position: relative; background: var(--surface); border-radius: 14px 14px 14px 4px; padding: 7px 12px 6px; min-width: 90px; box-shadow: 0 1px 1.5px rgba(0, 0, 0, .13); min-width: 0; }
.sp-msg.is-mine .sp-bubble { background: var(--sp-mine); border-radius: 14px 14px 4px 14px; }
.sp-who { font-size: 12.5px; font-weight: 700; color: var(--sp-accent); margin-bottom: 2px; }
.sp-msg.is-mine .sp-who { color: var(--muted); font-weight: 600; }
.sp-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.sp-time { text-align: right; font-size: 11px; color: var(--muted); margin-top: 2px; }
.sp-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sp-thumb { display: block; width: 128px; height: 96px; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.sp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-doc { display: flex; align-items: center; gap: 8px; max-width: 260px; padding: 6px 10px 6px 6px; border-radius: 8px; background: color-mix(in srgb, var(--surface-2) 80%, transparent); color: var(--text); text-decoration: none; border: 1px solid var(--border); }
.sp-doc .file-ext { width: 36px; height: 36px; }
.sp-doc-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.sp-doc-name small { display: block; color: var(--muted); }

.sp-compose { display: grid; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); background: var(--surface); }
.sp-compose textarea { width: 100%; resize: vertical; min-height: 64px; padding: 10px 12px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.sp-compose textarea:focus { outline: none; border-color: var(--sp-accent, var(--brand)); box-shadow: 0 0 0 3px var(--brand-soft); }
.sp-compose-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sp-compose-bar { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.sp-compose-bar .sp-attach { flex: 1; min-width: 200px; }
.sp-compose-bar > .btn-primary { margin-left: auto; }
.sp-compose-bar .check { align-self: center; }
.sp-compose .sp-attach-hint { display: none; }
.sp-attach { display: grid; gap: 6px; justify-items: start; }
.sp-attach.is-drag { outline: 2px dashed var(--sp-accent, var(--brand)); outline-offset: 4px; border-radius: 8px; }
.sp-clip { cursor: pointer; }
.sp-chosen { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.sp-chosen li { display: inline-flex; align-items: center; gap: 6px; max-width: 260px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; }
.sp-chosen li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-chosen li img { width: 22px; height: 22px; object-fit: cover; border-radius: 4px; }
.sp-chosen button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 4px; font-size: 16px; line-height: 1; }
.sp-new { padding: 18px 20px; max-width: 760px; }
.sp-new-head { display: grid; gap: 2px; margin-bottom: 6px; }
.sp-new-head strong { font-size: 17px; }
.sp-from { margin: 0; }

/* Админка */
.sp-tabs { flex-wrap: wrap; }
.sp-tabs .badge { margin-left: 4px; }
.badge-muted { background: var(--surface-2); color: var(--muted); }
.sp-table tr.is-waiting td { background: var(--warn-soft); }
.sp-table { table-layout: fixed; width: 100%; }
.sp-table col.c-n { width: 56px; } .sp-table col.c-a { width: 210px; } .sp-table col.c-m { width: 76px; } .sp-table col.c-s { width: 118px; }
.sp-table col.c-u { width: 132px; } .sp-table col.c-r { width: 120px; } .sp-table col.c-x { width: 52px; }
.sp-table td { overflow-wrap: anywhere; }
.sp-table-subj .muted { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-table-subj .icon { width: 14px; height: 14px; vertical-align: -2px; }
.sp-admin { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.sp-admin .sp-scroll { max-height: calc(100vh - var(--topbar-h) - var(--footer-h) - 400px); min-height: 280px; }
.sp-info { position: sticky; top: calc(var(--topbar-h) + 16px); margin-bottom: 70px; }
.sp-status select { width: 100%; height: 38px; padding: 0 10px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.sp-info-title { font-size: 16px; margin: 0 0 10px; }
.sp-info-sub { font-size: 14px; margin: 16px 0 6px; }
.sp-status { display: grid; gap: 4px; margin-bottom: 12px; }
.sp-info .facts { grid-template-columns: 1fr; gap: 2px; }
.sp-info .facts dt { margin-top: 8px; color: var(--muted); font-size: 12.5px; }
.sp-info .facts dd { margin: 0; }
.sp-author { display: inline-flex; align-items: center; gap: 8px; }
.sp-break { overflow-wrap: anywhere; }
.sp-others { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.sp-others li { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.sp-others .chip { font-size: 11px; padding: 1px 8px; flex: none; }
.sp-replies-body { left: 0; right: auto; width: min(460px, 90vw); }
.sp-replies-body ul { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; display: grid; gap: 4px; }
.sp-reply { display: grid; gap: 2px; width: 100%; text-align: left; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.sp-reply:hover { border-color: var(--sp-accent, var(--brand)); background: var(--surface-2); }
.sp-reply-text { white-space: pre-line; }
.sp-down .icon { transform: rotate(180deg); }
.adm-table tr.is-selected td { background: var(--brand-soft); }

@media (max-width: 1100px) {
    .sp-admin { grid-template-columns: minmax(0, 1fr); }
    .sp-info { position: static; }
}
@media (max-width: 860px) {
    .sp-table { table-layout: auto; }
    .sp-layout { grid-template-columns: minmax(0, 1fr); }
    .sp-side { position: static; max-height: none; }
    .sp-layout.has-ticket .sp-side { display: none; }
    .sp-layout:not(.has-ticket) .sp-side { order: 2; }
    .sp-back { display: inline-flex; }
    .sp-scroll, .sp-admin .sp-scroll { max-height: none; min-height: 0; }
    .sp-msg { max-width: 94%; }
    .sp-thumb { width: 104px; height: 80px; }
    .sp-new { padding: 14px; }
    .sp-compose { padding-bottom: 72px; } /* место под Канбанчика над нижними кнопками */
}

/* ===== С. 70б (интерфейс 24): «Партнёрская программа» — кабинет партнёра и админка ===== */
.pt-hero { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
.pt-hero h2 { margin: 0 0 6px; }
.pt-hero p { margin: 0 0 4px; max-width: 70ch; }
.pt-hero .pt-state { margin: 0; flex: 0 1 360px; }
.pt-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.pt-two > .card { margin: 0; }
.pt-rules { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; line-height: 1.5; }
.pt-rules code { font-size: 12px; word-break: break-all; }
.pt-kinds { display: grid; gap: 6px; }
.pt-link { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-start; justify-content: space-between; }
.pt-link-main { flex: 1 1 420px; min-width: 0; display: grid; gap: 8px; }
.pt-link-main p { margin: 0; }
.pt-link-row { margin: 0; flex-wrap: nowrap; }
.pt-link-row input { flex: 1 1 auto; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; }
.pt-code { font-size: 16px; letter-spacing: .08em; color: var(--text); }
.pt-qr > summary { list-style: none; cursor: pointer; }
.pt-qr > summary::-webkit-details-marker { display: none; }
.pt-qr-body { display: grid; justify-items: center; gap: 4px; margin-top: 8px; padding: 10px; background: #fff; border-radius: 8px; }
.pt-qr-body .muted { color: #666; }
.pt-stats .pt-avail strong { color: var(--ok); }
.pt-payout-bar form { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 0; }
.pt-payout-bar .btn[disabled] { opacity: .5; cursor: not-allowed; }
#requisites > details > summary, #terms > details > summary { cursor: pointer; list-style: none; margin: 0; }
#requisites > details > summary::-webkit-details-marker, #terms > details > summary::-webkit-details-marker { display: none; }
#requisites > details[open] > summary, #terms > details[open] > summary { margin-bottom: 4px; }
.pt-terms .pt-h1 { margin-top: 0; }
.adm-row-warn td { background: var(--warn-soft); }
@media (max-width: 860px) {
    .pt-two { grid-template-columns: minmax(0, 1fr); }
    .pt-link-row { flex-wrap: wrap; }
    .pt-link-row .btn { width: 100%; justify-content: center; }
}
.pt-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 600px) { .pt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pt-kinds label.check, .pt-kinds label.check span { font-weight: 400; }
/* с. 70б: во вкладках админки стало 9 разделов — поуже, чтобы на 1440 px помещались все */
.adm-nav a { padding: 10px 8px; gap: 5px; }
.adm-table td.pt-about { white-space: normal !important; min-width: 200px; max-width: 320px; }
/* с. 70б: партнёрская программа на лендинге и на странице правил для гостя */
.land-partner { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; border: 1px solid var(--border); border-radius: 12px; padding: 24px 28px; background: var(--surface); }
.land-partner-text { flex: 1 1 480px; min-width: 0; }
.land-partner-text h2 { margin-top: 0; }
.land-partner .land-actions { margin: 0; }
.pt-guest-cta { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; margin: 0 0 18px; padding: 16px 18px; border-radius: 10px; background: var(--brand-soft); }
.pt-guest-cta p { margin: 0; flex: 1 1 360px; }
.pt-guest-cta .form-actions { margin: 0; }
@media (max-width: 600px) { .pt-guest-cta .form-actions { width: 100%; } .pt-guest-cta .btn { width: 100%; justify-content: center; white-space: normal; height: auto; min-height: 40px; } }
/* с. 70б (замечание Романа): меню логотипа на гостевых страницах перекрывали тарифы, Канбанчик, плашка cookie —
   шапка поднимается над содержимым страницы, помощником (60) и плашкой cookie (70) */
.guest-top { position: relative; z-index: 80; }
.guest-menu { z-index: 81; max-height: calc(100vh - 120px); overflow-y: auto; }

/* ===== С. 70б: «Оплаты → Безубыточность» — калькулятор точки безубыточности (перенесён из артефакта «Безубыточность СУПРО 2027»; переменные — темы СУПРО) ===== */
.be { --bg: var(--surface-2); --panel: var(--surface); --ink: var(--text); --line: var(--border); --accent: var(--brand); --accent-soft: var(--brand-soft); --good: var(--ok); --good-soft: var(--ok-soft); --bad: var(--danger); --bad-soft: var(--danger-soft); --f-display: inherit; --f-body: inherit; --f-mono: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.be { color: var(--ink); font-size: 15px; line-height: 1.5; display: grid; gap: 20px; }
.be .wrap {  display: grid; gap: 20px; }
.be header h1 { font-family: var(--f-display); font-weight: 700; font-size: clamp(22px, 3.4vw, 32px); margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
.be header p { margin: 6px 0 0; color: var(--muted); max-width: 70ch; }
.be .eyebrow { font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.be .grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .be .grid { grid-template-columns: minmax(0, 1fr); } }
.be .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; display: grid; gap: 14px; min-width: 0; }
.be .panel h2 { font-family: var(--f-display); font-weight: 500; font-size: 16px; margin: 0; }
.be .panel h3 { font-size: 13px; font-weight: 600; margin: 4px 0 0; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.be .rows { display: grid; gap: 8px; }
.be .row { display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: 10px; align-items: center; }
.be .row label { min-width: 0; }
.be .row small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.be .row input, .be .row select {
  width: 100%; font: 500 14px var(--f-mono); color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; padding: 7px 8px; text-align: right; font-variant-numeric: tabular-nums;
}
.be .row select { text-align: left; font-family: var(--f-body); }
.be .row input:focus-visible, .be .row select:focus-visible, .be button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.be .row.wide { grid-template-columns: minmax(0, 1fr); }
.be .sum { display: flex; justify-content: space-between; gap: 10px; padding-top: 8px; border-top: 1px dashed var(--line); font-weight: 600; font-variant-numeric: tabular-nums; }
.be .result { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 12px); }
.be .status { border-radius: 8px; padding: 12px 14px; display: grid; gap: 4px; }
.be .status.bad { background: var(--bad-soft); color: var(--bad); }
.be .status.good { background: var(--good-soft); color: var(--good); }
.be .status b { font-family: var(--f-display); font-weight: 700; font-size: 26px; font-variant-numeric: tabular-nums; }
.be .status span { color: var(--ink); font-size: 13.5px; }
.be .bar { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.be .bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .25s; }
@media (prefers-reduced-motion: reduce) { .be .bar i { transition: none; } }
.be table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.be th, .be td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.be th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.be td.n, .be th.n { text-align: right; font-family: var(--f-mono); white-space: nowrap; }
.be .scroll { overflow-x: auto; }
.be .pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.be .pill.warn { background: var(--warn-soft); color: var(--warn); }
.be .pill.good { background: var(--good-soft); color: var(--good); }
.be .note { color: var(--muted); font-size: 13px; margin: 0; }
.be .chart svg { width: 100%; height: auto; display: block; }
.be .chart text { fill: var(--muted); font: 11px var(--f-mono); }
.be .two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 860px) { .be .two { grid-template-columns: minmax(0, 1fr); } }
.be ul.be-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.be button.preset { font: 500 13px var(--f-body); color: var(--accent); background: var(--accent-soft); border: 0; border-radius: 6px; padding: 6px 10px; cursor: pointer; }
.be .presets { display: flex; flex-wrap: wrap; gap: 8px; }
.be .kpi { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
@media (max-width: 760px) { .be .kpi { grid-template-columns: minmax(0, 1fr); } }
.be .kpi-item { display: grid; gap: 2px; padding: 8px 12px; border-radius: 8px; background: var(--bg); min-width: 0; }
.be .kpi-item.bad { background: var(--bad-soft); }
.be .kpi-item.bad b { color: var(--bad); }
.be .kpi-item.good { background: var(--good-soft); }
.be .kpi-item.good b { color: var(--good); }
.be .kpi-item b { font-family: var(--f-display); font-weight: 700; font-size: clamp(20px, 2.6vw, 28px); font-variant-numeric: tabular-nums; }
.be .kpi-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.be .kpi-note { font-size: 13px; color: var(--muted); }
.be .kpi-bar { grid-column: 1 / -1; }
.be .panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; }
.be table.clients td { vertical-align: middle; }
.be table.clients input, .be table.clients select { font: 500 14px var(--f-body); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
.be table.clients input.name { width: 100%; min-width: 180px; }
.be table.clients input.sm { width: 84px; text-align: right; font-family: var(--f-mono); }
.be table.clients select.sm { width: auto; }
.be .mode { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.be .pchk { display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; font-size: 13.5px; }
.be .pchk input { width: auto; }
.be td.n .pnote { white-space: nowrap; font-family: var(--f-body); font-size: 12px; text-align: right; }
.be button.del { border: 0; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; padding: 2px 8px; border-radius: 6px; }
.be button.del:hover { background: var(--bad-soft); color: var(--bad); }
.be details.panel > summary { cursor: pointer; list-style: none; }
.be details.panel > summary::-webkit-details-marker { display: none; }
.be details.panel > summary h2::after { content: " ▾"; color: var(--muted); font-size: 13px; }
.be-fact { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.be-fact div { display: flex; flex-direction: column; }
.be-fact strong { font-size: 20px; line-height: 1.25; }
.be-fact span { font-size: 13px; color: var(--muted); }
.be ul.be-list li { display: list-item; }

/* С. 70г: API — админка и подключение сервиса */
.adm-grid { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.adm-grid .card + .card { margin-top: 0; }
.adm-grid .form > .field, .adm-grid .form > .check, .adm-grid .form > fieldset { margin-top: 10px; }
@media (max-width: 1100px) { .adm-grid { grid-template-columns: minmax(0, 1fr); } }
.connect-card { max-width: 720px; }
.connect-scopes { list-style: none; padding: 0; margin: 8px 0 12px; display: grid; gap: 6px; }
.connect-scopes li { display: flex; gap: 8px; align-items: flex-start; }
.connect-scopes .icon { color: var(--ok, #2e7d32); flex: none; margin-top: 2px; }
form.inline { display: inline; }
.svc-list { list-style: none; margin: 0; padding: 0; }
.svc-item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.svc-item:first-child { border-top: 0; }
.svc-item > .grow { min-width: 0; flex: 1 1 260px; display: grid; gap: 4px; }
.svc-item.is-off { opacity: .6; }
@media (max-width: 600px) { .svc-item { flex-wrap: wrap; } }

/* С. 70д: «Статистика по доскам» (3.2.7 v4) — проекты с раскрываемыми досками */
.bst-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 10px; }
.bst-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bst-table td.num, .bst-table th.num { text-align: right; white-space: nowrap; }
.bst-table th.bst-late, .bst-table td.bst-late { color: var(--danger, #d93025); }
.bst-toggle { display: inline-flex; align-items: center; gap: 6px; margin-left: calc(var(--lvl, 0) * 18px); padding: 2px 4px; font: inherit; font-weight: 600; color: var(--text); background: none; border: 0; border-radius: 6px; cursor: pointer; text-align: left; }
.bst-toggle:hover:not(:disabled) { background: var(--surface-2); }
.bst-toggle:disabled { cursor: default; opacity: .75; }
.bst-toggle:disabled .chev { visibility: hidden; }
.bst-toggle .chev { transition: transform .15s; }
.bst-toggle[aria-expanded="true"] .chev { transform: rotate(90deg); }
.bst-open { margin-left: 4px; color: var(--muted); vertical-align: middle; }
.bst-board td { background: var(--surface-2); font-size: 14px; }
.bst-board-link { display: inline-flex; align-items: center; gap: 6px; margin-left: calc(var(--lvl, 1) * 18px + 22px); }
.bst-total td { font-weight: 700; border-top: 2px solid var(--border); }
.bst-table .chip { margin-left: 6px; font-size: 12px; }
@media (max-width: 860px) {
    .bst-table thead { display: none; }
    .bst-table tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
    .bst-table td { border: 0; padding: 2px 4px; }
    .bst-table td:empty { display: none; }
    .bst-table td.num { text-align: left; font-size: 13px; }
    .bst-table td.num::before { content: attr(data-label) ": "; color: var(--muted); }
    .bst-table td:nth-child(2) { grid-column: 1 / -1; }
    .bst-table tr td:first-child.num { display: none; }
    .bst-toggle, .bst-board-link { margin-left: 0; }
}

/* С. 70д: шаблоны досок */
.tpl-head { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.tpl-h { font-size: 17px; margin: 0 0 8px; }
.tpl-card { margin-bottom: 10px; }
.tpl-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; }
.tpl-name { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; }
.tpl-desc { margin: 6px 0 0; }
.tpl-lines { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tpl-line { padding: 2px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; }
.tpl-more, .tpl-edit { margin-top: 8px; }
.tpl-more > summary, .tpl-edit > summary { cursor: pointer; color: var(--brand); font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.tpl-more[open] { display: block; }
.tpl-more[open] > summary { margin-bottom: 6px; }
.tpl-col { margin: 6px 0 10px; }
.tpl-tasks { margin: 4px 0 0 18px; padding: 0; font-size: 14px; }
.tpl-tasks .tpl-tasks { margin-left: 18px; }
.tpl-labels { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.tpl-label { padding: 1px 8px; border-radius: 4px; min-width: 24px; }
.tpl-edit form { margin-top: 8px; }
.tpl-edit form + form { margin-top: 10px; }
.tpl-sort input { max-width: 120px; }

/* С. 70д: тест «Кто ты в лесной компании?» */
.ft { max-width: 860px; margin: 0 auto; display: grid; gap: 12px; }
.ft-title { font-size: 26px; margin: 0 0 8px; }
.ft-lead { font-size: 16px; }
.ft-types { list-style: none; padding: 0; margin: 14px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; text-align: center; }
.ft-types li { display: grid; justify-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.ft-types img { width: 96px; height: 96px; }
.ft-have { padding: 8px 12px; border-radius: 8px; background: var(--surface-2); }
.ft-q { border: 0; padding: 0; margin: 0 0 18px; }
.ft-q legend { font-weight: 700; font-size: 18px; margin-bottom: 10px; padding: 0; }
.ft-num { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }
.ft-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: var(--surface); }
.ft-opt:hover { border-color: var(--brand); }
.ft-opt:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--surface)); }
.ft-opt input { margin-top: 3px; accent-color: var(--brand); }
.ft-err { color: var(--danger, #d93025); margin: 4px 0 0; }
.ft-nav { display: flex; gap: 8px; justify-content: space-between; }
.ft-nav [data-forest-submit], .ft-nav [data-forest-next] { margin-left: auto; }
.ft-progress { display: grid; gap: 6px; margin-bottom: 14px; }
.ft-track { display: block; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; flex: 1; }
.ft-fill { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 999px; transition: width .2s; }
.ft-result { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: center; border-top: 4px solid var(--ft, var(--brand)); }
.ft-badge { width: 200px; height: 200px; }
.ft-caption { margin: 0; color: var(--muted); }
.ft-tagline { font-weight: 600; color: var(--ft, var(--brand)); }
.ft-note { padding: 8px 12px; border-radius: 8px; background: var(--surface-2); }
.ft-sections { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ft-sections h2, .ft h2 { font-size: 17px; margin: 0 0 8px; }
.ft-sections ul { margin: 0; padding-left: 18px; }
.ft-bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ft-bars li { display: grid; grid-template-columns: 160px minmax(0, 1fr) 48px; gap: 10px; align-items: center; }
.ft-bars b { text-align: right; }
@media (max-width: 760px) {
    .ft-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ft-result { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
    .ft-badge { width: 160px; height: 160px; }
    .ft-sections { grid-template-columns: minmax(0, 1fr); }
    .ft-bars li { grid-template-columns: 1fr 40px; } .ft-bars .ft-track { grid-column: 1 / -1; grid-row: 2; }
    .ft-nav .btn { flex: 1; }
}
/* значок теста — в левом нижнем углу аватара (кубок — в правом) */
.avatar-forest { position: absolute; left: calc(var(--av) * -0.18); bottom: calc(var(--av) * -0.18); width: calc(var(--av) * .5); height: calc(var(--av) * .5); min-width: 14px; min-height: 14px; z-index: 2; pointer-events: none; max-width: none; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.profile-forest { display: flex; gap: 12px; align-items: center; }
.profile-forest img { width: 64px; height: 64px; flex: none; }
.land-test-badges { display: flex; gap: 8px; margin-top: 8px; }
.land-test-badges img { width: 56px; height: 56px; }
/* с. 70д: во время теста облачко Канбанчика не закрывает «Далее» (на телефоне) */
body:has(.ft.is-running) .helper-bubble { display: none !important; }
@media (max-width: 760px) { .ft { padding-bottom: 72px; } }

/* С. 70д: «Калькуляторы» — НДС и обычный */
.calc-page { max-width: 960px; margin: 0 auto; display: grid; gap: 10px; }
.calc-tabs { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 4px 6px 0; margin: 0; }
.calc-tabs button { font-size: 15px; padding: 8px 12px; }
.calc-card { padding: 18px; }
.vat-form { display: grid; gap: 14px; }
.vat-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vat-mode label { display: block; cursor: pointer; }
.vat-mode input { position: absolute; opacity: 0; pointer-events: none; }
.vat-mode span { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-weight: 600; background: var(--surface-2); }
.vat-mode small { font-weight: 400; color: var(--muted); font-size: 12px; }
.vat-mode input:checked + span { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--brand-soft); }
.vat-mode input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.vat-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.vat-field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); min-width: 0; }
.vat-field input, .vat-field select { height: 42px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; font: inherit; font-size: 16px; color: var(--text); background: var(--surface); }
.vat-amount { flex: 1 1 240px; }
.vat-amount input { font-size: 22px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.vat-custom input { width: 110px; }
.vat-result { display: grid; gap: 2px; margin-top: 16px; border-top: 1px solid var(--border); padding-top: 8px; }
.vat-line { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.vat-line.is-vat .vat-v b { color: var(--brand); }
.vat-l { font-size: 14px; }
.vat-l b { font-weight: 400; color: var(--muted); margin-left: 4px; }
.vat-v { display: inline-flex; align-items: center; gap: 4px; font-size: 20px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vat-w { grid-column: 1 / -1; }
.vat-phrase { margin-top: 10px; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; display: grid; gap: 6px; justify-items: start; }
.vat-phrase p { margin: 0; line-height: 1.45; }
.vat-note { margin: 12px 0 0; }
.is-copied { color: var(--success, #2e7d32) !important; }
.calc-wrap { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 18px; align-items: start; }
.calc-body { display: grid; gap: 10px; }
.calc-screen { position: relative; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; text-align: right; min-height: 92px; display: grid; align-content: end; }
.calc-expr { min-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calc-display { font-size: 38px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.calc-display.is-long { font-size: 24px; }
.calc-mem { position: absolute; left: 12px; top: 8px; }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.calc-key { height: 52px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 18px; cursor: pointer; user-select: none; touch-action: manipulation; }
.calc-key:hover { filter: brightness(0.96); }
.calc-key.is-num { background: var(--surface); font-weight: 600; }
.calc-key.is-op { font-size: 22px; }
.calc-key.is-mem { font-size: 14px; color: var(--muted); }
.calc-key.is-eq { grid-column: 1 / -1; background: var(--brand); color: var(--brand-text); border-color: var(--brand); font-size: 22px; }
.calc-key.is-pressed, .calc-key:active { transform: scale(0.97); filter: brightness(0.9); }
.calc-side { display: grid; gap: 8px; align-content: start; justify-items: start; }
.calc-side-head { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.calc-history { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; width: 100%; }
.calc-history button { display: grid; width: 100%; text-align: right; border: 0; background: none; padding: 6px 8px; border-radius: 6px; font: inherit; color: var(--text); cursor: pointer; font-variant-numeric: tabular-nums; }
.calc-history button:hover { background: var(--surface-2); }
.calc-history b { font-size: 18px; }
@media (max-width: 760px) {
    .calc-card { padding: 12px; }
    .vat-mode { grid-template-columns: 1fr; }
    .vat-row > .vat-field:not(.vat-amount) { flex: 1 1 140px; }
    .vat-v { font-size: 17px; }
    .calc-wrap { grid-template-columns: minmax(0, 1fr); }
    .calc-key { height: 56px; }
}

/* С. 70д: вышестоящие органы управления над оргструктурой */
.org-stack { display: grid; justify-items: center; min-width: max-content; }
.org-stack > .org-chart { justify-self: stretch; }
.org-superiors { display: grid; justify-items: center; gap: 6px; margin: 0 0 4px; position: relative; padding-bottom: 20px; }
.org-superiors::after { content: ""; position: absolute; bottom: 0; left: 50%; height: 20px; border-left: 2px dashed var(--border); }
.org-superiors-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.org-superior { display: grid; gap: 2px; text-align: center; max-width: 280px; padding: 8px 14px; border: 2px dashed var(--muted); border-radius: 8px; background: var(--surface); }
.sup-item { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.sup-new h3 { margin: 0 0 6px; font-size: 15px; }
.verify-change { margin-top: 14px; max-width: 420px; display: grid; gap: 10px; justify-items: start; }
.verify-change .field { width: 100%; }
.helper-faq .helper-faq-cap { margin: 10px 0 2px; color: var(--muted); }
.helper-panel.is-searching .helper-hello, .helper-panel.is-searching .helper-tips { display: none; }

/* ===== С. 70з: «Статистика по доскам» — скорость и сроки, люди, «Что можно улучшить» ===== */
.bst-advice { margin-bottom: 12px; padding: 12px 16px; border-left: 4px solid var(--brand); }
.bst-advice-title { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 16px; }
.bst-advice-ava { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.bst-advice-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bst-adv { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.45; }
.bst-adv-icon { flex: 0 0 auto; }
.bst-adv-link { margin-left: 6px; white-space: nowrap; font-size: 13px; }
.bst-adv.is-ok { color: var(--success, #1e8e3e); }
.bt-tr { display: inline-block; margin-left: 2px; font-size: 10px; vertical-align: 1px; cursor: default; }
.bt-tr.is-good { color: var(--success, #1e8e3e); }
.bt-tr.is-bad { color: var(--danger, #d93025); }
.bst-speed th.num { white-space: normal; min-width: 0; font-size: 12px; line-height: 1.2; }
.bst-speed th, .bst-speed td { padding-left: 6px; padding-right: 6px; vertical-align: middle; }
.bst-speed td:nth-child(2) { min-width: 220px; }
.bst-speed .bst-toggle span, .bst-speed .bst-board-name { white-space: normal; }
.bst-board-cell, .bst-line-cell { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin-left: calc(var(--lvl, 1) * 18px); }
.bst-board-cell { flex-wrap: nowrap; }
.bst-board-name { display: inline-flex; align-items: center; gap: 6px; }
.bst-lines-toggle { display: inline-flex; padding: 2px; color: var(--muted); background: none; border: 0; border-radius: 6px; cursor: pointer; }
.bst-lines-toggle:hover:not(:disabled) { background: var(--surface); color: var(--text); }
.bst-lines-toggle:disabled { visibility: hidden; }
.bst-lines-toggle .chev { transition: transform .15s; }
.bst-lines-toggle[aria-expanded="true"] .chev { transform: rotate(90deg); }
.bst-line td { font-size: 13px; background: var(--surface-2); }
.bst-line td[colspan] { white-space: normal; }
.bst-line-name { font-weight: 600; }
.bst-line-name.is-stale { color: var(--danger, #d93025); }
.bst-table .chip-warn { background: color-mix(in srgb, var(--danger, #d93025) 14%, transparent); color: var(--danger, #d93025); }
.bst-note { margin: 10px 2px 0; }
.bst-people .rating-user { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; }
.bst-people .rt-sort, .bst-people th .rt-sort { font: inherit; font-weight: 600; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
@media (max-width: 860px) {
    .bst-speed td:nth-child(2) { min-width: 0; }
    .bst-speed tr, .bst-people tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .bst-speed td, .bst-people td { min-width: 0; white-space: normal; }
    .bst-line td[colspan] { grid-column: 1 / -1; }
    .bst-line-cell { display: block; }
    .bst-board-cell, .bst-line-cell { margin-left: 0; }
    .bst-advice { padding: 10px 12px; }
    .bst-adv-link { white-space: normal; }
}

/* ——— С. 70и: совместные доски ——— */
:root { --collab: #0f9d8a; --collab-soft: color-mix(in srgb, #0f9d8a 12%, transparent); }
.board-collab .board-nav:not(.is-completed):not(.is-archived) { border: 2px solid var(--collab); box-shadow: 0 0 0 3px var(--collab-soft), var(--shadow); }
.collab-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
    background: var(--collab); color: #fff; white-space: nowrap; }
.collab-chip svg { width: 14px; height: 14px; }
.collab-strip { display: flex; align-items: center; gap: 8px 14px; flex-wrap: nowrap; overflow: hidden; padding: 4px 12px; margin: -6px 0 12px;
    background: var(--collab-soft); border: 1px dashed var(--collab); border-radius: var(--radius); }
.collab-group { display: flex; align-items: center; gap: 8px; min-width: 0; padding-right: 14px; border-right: 1px solid color-mix(in srgb, var(--collab) 35%, transparent); }
.collab-group:last-of-type { border-right: 0; }
.collab-team { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; max-width: 220px; }
.collab-team-name { overflow: hidden; text-overflow: ellipsis; }
.collab-team svg { width: 18px; height: 18px; color: var(--collab); }
.collab-tag { font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 999px; background: var(--collab); color: #fff; }
.collab-group.is-host .collab-team-name::after { content: " · хозяин"; font-weight: 400; color: var(--muted); }
.collab-group { flex: 0 1 auto; }
.collab-people { display: flex; gap: 2px; flex-wrap: nowrap; align-items: center; min-width: 0; overflow: hidden; }
.collab-more { flex: 0 0 auto; min-width: 32px; height: 32px; padding: 0 6px; border-radius: 999px; border: 1px solid var(--collab); background: var(--surface);
    color: var(--collab); font-weight: 700; font-size: 12px; cursor: pointer; }
.collab-people .board-person { padding: 2px; }
.collab-open { margin-left: auto; white-space: nowrap; flex: 0 0 auto; padding: 4px 12px; min-height: 32px; }
.collab-group { min-width: 0; }
.collab-more-list > summary { cursor: pointer; color: var(--link); margin: 2px 0 6px; }
.collab-modal { max-height: calc(100vh - 40px); overflow-y: auto; }
.collab-modal { width: min(640px, calc(100vw - 32px)); }
.collab-h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 18px 0 6px; }
.collab-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.collab-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.collab-list .grow { flex: 1 1 200px; min-width: 0; }
.collab-list form { margin: 0; }
.collab-remove { position: relative; }
.collab-remove[open] > form { position: absolute; right: 0; top: 100%; z-index: 5; width: 280px; padding: 10px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.collab-mail { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; border-radius: 50%; background: var(--surface-2); color: var(--muted); }
.collab-invite { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.collab-invite .field { margin: 0; }
.collab-invite .grow { flex: 1 1 220px; }
.collab-leave { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); }
.collab-check { margin: 4px 0 8px; align-items: flex-start; }
.desk-h2 { display: flex; align-items: center; gap: 8px; font-size: 18px; margin: 0 0 4px; }
.desk-h2 svg { color: var(--collab); }
.collab-card { border-left: 4px solid var(--collab); text-decoration: none; display: flex; flex-direction: column; gap: 6px; }
.collab-card-team { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
@media (max-width: 860px) {
    .collab-strip { margin-top: 0; flex-wrap: wrap; }
    .collab-group { display: none; } /* на телефоне, как люди обычной доски, — только кнопка */
    .collab-open { margin-left: 0; width: 100%; justify-content: center; }
}

.desk-board .collab-chip { align-self: flex-start; margin-top: 4px; }
.collab-count { font-size: 12px; font-weight: 700; color: var(--collab); }

/* ——— С. 71: договоры с командами (админка и «Тариф») ——— */
.ct-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 14px; }
.ct-form-grid .ct-span { grid-column: 1 / -1; }
.ct-new { margin-top: 12px; }
.ct-new > summary { list-style: none; cursor: pointer; display: inline-flex; }
.ct-new > summary::-webkit-details-marker { display: none; }
.ct-new[open] > summary { margin-bottom: 10px; }
.ct-head { display: flex; gap: 24px; flex-wrap: wrap; justify-content: space-between; }
.ct-head h2 { margin: 0 0 4px; }
.ct-head-main { flex: 1 1 360px; min-width: 0; }
.ct-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ct-sum { display: grid; grid-template-columns: auto auto; gap: 4px 16px; margin: 0; font-size: 14px; align-content: start; }
.ct-sum dt { color: var(--muted); }
.ct-sum dd { margin: 0; }
.ct-docs { list-style: none; margin: 0; padding: 0; }
.ct-docs li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.ct-docs li:last-child { border-bottom: 0; }
.ct-docs li .grow { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.ct-docs li .muted { display: block; }
.ct-list { display: grid; gap: 12px; }
.ct-item { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.ct-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ct-item p { margin: 6px 0; }
.ct-doc-links { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.ct-doc-links li { display: inline-flex; align-items: center; gap: 6px; }
.inline-h { display: inline; font-size: 1.1rem; margin: 0; }
@media (max-width: 600px) {
    .ct-head { flex-direction: column; gap: 12px; }
}

/* ===== С. 74: матрица Эйзенхауэра как в СУПРО 4 — пять частей на всё окно, прокрутка внутри частей ===== */
.page-eh .content-inner { max-width: none; }
.page-eh .content { padding: 12px 16px 10px; }
.eh5 .eh-col { min-height: 0; padding: 10px; display: flex; flex-direction: column; }
.eh5 .eh-col h2 { flex: none; }
.eh5 .eh-list { min-height: 60px; }
.eh5 .eh-free .eh-scope { width: 100%; margin-bottom: 10px; }
.eh5 .eh-free .eh-scope select { min-width: 0; flex: 1; }
.eh-free-foot { flex: none; padding-top: 10px; }
.eh-free-foot .btn { width: 100%; justify-content: center; }
.eh-axis-top span, .eh-axis-left span { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }
.eh-tabs { display: none; }
.eh-card { touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.eh-card.is-dragging { opacity: .35; }
.eh-ghost { position: fixed; z-index: 90; pointer-events: none; width: 260px; transform: rotate(2deg); box-shadow: 0 10px 30px rgba(0, 0, 0, .3); opacity: .95; }
.eh-list.is-over { outline: 2px dashed var(--brand); outline-offset: -2px; background: color-mix(in srgb, var(--brand) 6%, transparent); }
.eh-card.is-moved { animation: eh-moved 1.2s ease; }
@keyframes eh-moved { 0% { box-shadow: 0 0 0 3px var(--brand); } 100% { box-shadow: none; } }
.eh-menu { position: fixed; z-index: 95; min-width: 240px; max-width: calc(100vw - 24px); padding: 6px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0, 0, 0, .28); display: flex; flex-direction: column; }
.eh-menu[hidden] { display: none; }
.eh-menu-title { padding: 6px 10px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eh-menu button { display: flex; align-items: center; gap: 8px; text-align: left; padding: 10px; font: inherit; font-size: 15px; background: none; border: 0; border-radius: var(--radius-sm); color: var(--text); cursor: pointer; }
.eh-menu button:hover, .eh-menu button.is-current { background: var(--surface-2); }
.eh-menu button.is-current::after { content: "✓"; margin-left: auto; color: var(--muted); }
@media (min-width: 861px) {
    .page-eh .shell { min-height: 0; }
    .page-eh .sidebar { height: calc(100vh - var(--topbar-h) - var(--footer-h) - var(--banner-h, 0px)); }
    .page-eh .content { height: calc(100vh - var(--topbar-h) - var(--footer-h, 46px) - var(--banner-h, 0px)); display: flex; flex-direction: column; overflow: hidden; }
    .page-eh .content-inner { flex: 1; min-height: 0; display: flex; flex-direction: column; width: 100%; }
    .eh5 { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(260px, 22%) minmax(0, 1fr); gap: 14px; }
    .eh5 .eh-list { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; padding: 2px 4px 2px 2px; }
    .eh-board { min-height: 0; display: grid; grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; }
    .eh-axis-top { grid-column: 2 / 4; grid-row: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; text-align: center; }
    .eh-axis-left { grid-column: 1; grid-row: 2 / 4; display: grid; grid-template-rows: 1fr 1fr; gap: 8px; }
    .eh-axis-left span { writing-mode: vertical-rl; transform: rotate(180deg); align-self: center; justify-self: center; }
    .eh5 .eh-q1 { grid-column: 2; grid-row: 2; } .eh5 .eh-q2 { grid-column: 3; grid-row: 2; }
    .eh5 .eh-q3 { grid-column: 2; grid-row: 3; } .eh5 .eh-q4 { grid-column: 3; grid-row: 3; }
}
@media (max-width: 860px) {
    .eh-tabs { display: grid; grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)); gap: 4px; margin-bottom: 10px; }
    .eh-tabs button { min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 6px 4px; white-space: nowrap; font: inherit; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; cursor: pointer; }
    .eh-tabs button.is-active { background: var(--brand); border-color: var(--brand); color: var(--brand-text, #fff); }
    .eh-tabs b { font-weight: 700; }
    .eh-axis-top, .eh-axis-left { display: none; }
    .eh5 .eh-col { display: none; }
    .eh5[data-tab="0"] .eh-free, .eh5[data-tab="1"] .eh-q1, .eh5[data-tab="2"] .eh-q2, .eh5[data-tab="3"] .eh-q3, .eh5[data-tab="4"] .eh-q4 { display: flex; }
    .eh-menu { left: 12px !important; right: 12px; bottom: calc(var(--mobilebar-h, 60px) + 12px); top: auto !important; min-width: 0; }
}

/* С. 74: матрица — на всю ширину экрана и при свёрнутом меню (правило html.sidebar-mini .content-inner ограничивало 1400 px) */
:root .page-eh .content-inner, html.sidebar-mini .page-eh .content-inner { max-width: none; margin: 0; }
/* С. 74: цвет срока в «Моих задачах» и матрице: просрочено — красный, сегодня/завтра — жёлтый, не наступил — зелёный */
.task-due.is-ok { color: #1e8f3e; font-weight: 600; }
.task-due.is-soon { color: #b77900; font-weight: 600; }
:root[data-theme="standard"] .taskbar .task-due.is-ok, :root[data-theme="dark"] .task-due.is-ok { color: #6fd38a; }
:root[data-theme="standard"] .taskbar .task-due.is-soon, :root[data-theme="dark"] .task-due.is-soon { color: #f2c14e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .task-due.is-ok { color: #6fd38a; } :root:not([data-theme]) .task-due.is-soon { color: #f2c14e; } }

/* С. 74: совместная доска, где человек ещё не был, — метка «Новая» */
.collab-card { position: relative; }
.collab-new { position: absolute; top: 8px; right: 8px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--accent, #ff7a1a); color: #fff; }

/* С. 74: лишний ползунок вправо в линиях — скрытые подсказки ::after у значков и меток (ширина до 280 px) раздвигали прокрутку линии.
   Подсказку рисует JS (.ftip в <body>), псевдоэлементы отключены. */
.card-icons [data-tip]::after, .card-flag[data-tip]::after { content: none !important; display: none !important; }
.page-board .line-cards { overflow-x: hidden; }
.page-board .task-card { -webkit-touch-callout: none; }
.line-move-menu { left: 12px; right: 12px; bottom: calc(var(--mobilebar-h, 60px) + 12px); max-height: 70vh; overflow-y: auto; }

/* С. 74: задачи ушедших сотрудников на доске */
.departed-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 10px; }
.departed-dialog { width: min(640px, calc(100vw - 24px)); }
.departed-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; }
.departed-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.departed-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.departed-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.departed-form select { height: 34px; max-width: 260px; padding: 0 8px; font: inherit; font-size: 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }

/* С. 74: меню разделов команды закреплено под шапкой на всех страницах команды */
body:has(.team-subnav) { --subnav-h: 46px; }
.subnav.team-subnav { position: sticky; top: var(--topbar-h); z-index: 25; height: 46px; box-sizing: border-box; align-items: stretch;
    margin: -8px 0 12px; padding: 0 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 2px 8px rgba(0, 0, 0, .06); }
.subnav.team-subnav a { padding: 0 14px; margin-bottom: 0; border-bottom-width: 3px; }
body:has(.team-subnav) .tc-bar { top: calc(var(--topbar-h) + var(--subnav-h)); }
body:has(.team-subnav) .rl-table thead th { top: calc(var(--topbar-h) + var(--subnav-h)); }

/* С. 74: подчинённые без своих подчинённых — по два в ряд, общая линия между колонками, отвод к каждой карточке */
.org-chart ul.org-pair { display: grid; grid-template-columns: repeat(2, max-content); column-gap: 56px; row-gap: 0; justify-content: center; }
.org-chart ul.org-pair > li { padding: 52px 12px 0; }
.org-chart ul.org-pair > li > .org-plate { width: 200px; }
.org-chart ul.org-pair > li::before, .org-chart ul.org-pair > li::after { content: ""; position: absolute; display: block; border: 0; border-radius: 0; width: auto; height: auto; }
/* общая линия — у карточек левой колонки (весь их ряд), в последнем ряду — до отвода */
.org-chart ul.org-pair > li:nth-child(odd)::before { top: 0; bottom: 0; right: -28px; left: auto; width: 0; border-right: 1px solid var(--org-line, var(--border)); }
.org-chart ul.org-pair > li:nth-child(odd):nth-last-child(-n+2)::before { bottom: auto; height: 92px; }
/* отвод к карточке */
.org-chart ul.org-pair > li::after { top: 92px; width: 40px; height: 0; border-top: 1px solid var(--org-line, var(--border)); }
.org-chart ul.org-pair > li:nth-child(odd)::after { right: -28px; left: auto; }
.org-chart ul.org-pair > li:nth-child(even)::after { left: -28px; right: auto; }
/* С. 74: отводы от общей линии доходят до аватара (без «крючков» и разрывов при масштабе 110–150 %) */
.page-org .org-chart ul:not(.org-pair) > li::before, .page-org .org-chart ul:not(.org-pair) > li::after { height: 30px; }
.page-org .org-chart ul:not(.org-pair) > li:first-child::after, .page-org .org-chart ul:not(.org-pair) > li:last-child::before { border-radius: 0; }
.page-org .org-chart ul.org-pair::before { height: 22px; }
/* С. 74: структурное подразделение на карточке — строкой над должностью */
.org-dept { display: block; margin: 0 0 2px; font-size: 10.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; line-height: 1.25; color: var(--brand); opacity: .75; }
.org-dept.is-own { opacity: 1; }

/* С. 74: штатное расписание Т-3 — окно выгрузки/загрузки и предпросмотр */
.stf-block { padding: 12px 0; border-top: 1px solid var(--border); }
.stf-block:first-of-type { border-top: 0; }
.stf-block h3 { margin: 0 0 6px; font-size: 15px; }
.stf-preview { width: min(900px, calc(100vw - 32px)); }
.stf-table-wrap { max-height: 50vh; overflow: auto; border: 1px solid var(--border); border-radius: 6px; margin: 10px 0; }
.stf-table { width: 100%; font-size: 13px; }
.stf-table th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.stf-table .num { text-align: right; white-space: nowrap; }
.stf-table tr.is-new td:last-child { font-weight: 700; color: var(--ok, #2e7d32); }
.stf-preview .form-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* С75: выезжающие панели (меню, «Мои задачи», правая панель, меню задачи) за краем экрана не должны расширять страницу.
   В мобильных Яндекс.Браузере и Samsung Internet спрятанная сдвигом панель увеличивала ширину страницы —
   нижние кнопки растягивались на эту ширину: «Меню» уезжало в середину, «Задачи» — за экран. */
html { overflow-x: hidden; }
@media (max-width: 1279px) {
    .taskbar, .rightbar { visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s; }
    html.taskbar-open .taskbar, html.rightbar-open .rightbar { visibility: visible; transition: transform .2s ease; }
}
@media (max-width: 860px) {
    .sidebar { visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s; }
    body.menu-open .sidebar { visibility: visible; transition: transform .2s ease; }
    .tp-menu { visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s; }
    .tp.menu-open .tp-menu { visibility: visible; transition: transform .2s ease; }
    .mobile-bar { width: 100%; max-width: 100vw; z-index: 46; } /* выше затемнения панели задач (44) — кнопка «Задачи» закрывает панель, как и было задумано */
}
/* С75: паспорт проекта на телефоне уезжал вбок — длинные имена файлов без пробелов («…_2023_16_50_02.zip») растягивали окно шире экрана */
.ppt-main, .ppt-menu { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 860px) {
    .ppt[open] { width: 100%; max-width: 100%; inset: 0; overflow-x: hidden; }
}
/* С75: кнопка «Снять фото» — только на телефонах и планшетах (на компьютере камеры для снимка обычно нет) */
.cam-only { display: none !important; }
@media (pointer: coarse) { .cam-only { display: inline-flex !important; } }
.comment-pending { flex-basis: 100%; margin: 0; }
.comment-pending:empty { display: none; }
/* С75: на телефоне список категорий главной растягивался по самому длинному названию категории
   («Новости в сфере управления поставками…») и вылезал за экран — теперь не шире строки */
.home-cat { min-width: 0; max-width: 100%; }
.home-cat select { width: 100%; max-width: 420px; text-overflow: ellipsis; }
@media (max-width: 860px) {
    .home-cat { flex: 1 1 100%; }
    .home-cat select { max-width: 100%; }
}
/* С75 (решение Романа 08.11): кнопки нового комментария к задаче — строками:
   1) «@ упомянуть» и смайлики, 2) «Приложить файлы» и «Сделать фото» по ширине, 3) выбранные файлы, 4) «Добавить комментарий» */
.comment-new .comment-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.comment-new .ca-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.comment-new .ca-tools .person-add { flex: 1 1 auto; min-width: 0; max-width: 320px; height: 36px; font-size: 14px; }
.comment-new .ca-files .comment-attach { font-size: 14px; white-space: nowrap; }
.comment-new .ca-files .comment-attach { justify-content: center; }
.comment-new .comment-send { align-self: flex-start; }
.comment-new .comment-pending { margin: 0; }
.comment-new [data-comment-error]:empty { display: none; }
@media (max-width: 860px) {
    .comment-new .ca-tools .person-add { max-width: none; }
    .comment-new .comment-send { align-self: stretch; justify-content: center; }
    .comment-new .ca-files { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
    .comment-new .ca-files .comment-attach { padding: 0 8px; min-width: 0; }
}
.rte-bar .cam-only { align-items: center; justify-content: center; }
.rte-bar .cam-only .icon { width: 18px; height: 18px; }
/* С75: нижние кнопки поднимаются над панелью браузера (--vv-gap считает app.js по visualViewport) */
@media (max-width: 860px) {
    .mobile-bar { bottom: var(--vv-gap, 0px); transition: bottom .15s ease; }
    .app-page .helper { bottom: calc(var(--mobilebar-h) + 12px + var(--vv-gap, 0px)); }
    .app-page .taskbar { bottom: calc(var(--mobilebar-h) + env(safe-area-inset-bottom) + var(--vv-gap, 0px)); }
    .app-page { padding-bottom: calc(var(--mobilebar-h) + env(safe-area-inset-bottom) + var(--vv-gap, 0px)); }
}

/* С. 75: листание страниц (->links()) */
.pg { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 14px 0 4px; }
.pg-nums { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; justify-content: center; }
.pg-btn, .pg-num { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); text-decoration: none; font-size: 14px; line-height: 1; }
.pg-num { padding: 0 6px; }
a.pg-btn:hover, a.pg-num:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.pg-num.is-current { background: var(--brand); border-color: var(--brand); color: var(--brand-text); font-weight: 600; }
.pg-btn[aria-disabled="true"] { opacity: .45; }
.pg-gap { padding: 0 2px; color: var(--muted); }
@media (max-width: 560px) { .pg-nums { order: 3; flex-basis: 100%; } .pg { gap: 8px; } }

/* С82 (сквозная проверка 09.11.2026): на телефоне 390 px страницы не должны уезжать вбок */
.calc-page { grid-template-columns: minmax(0, 1fr); }
.vat-mode { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.requisites { table-layout: fixed; width: 100%; }
.requisites td, .requisites th { overflow-wrap: anywhere; }
.guest-top { min-width: 0; }
.guest-top .actions { min-width: 0; flex-shrink: 0; }
.vat-form { grid-template-columns: minmax(0, 1fr); }
.vat-field input, .vat-field select { min-width: 0; width: 100%; }
/* С82: на планшете (701–1100 px) поиск и «Инструменты» доски уезжали за край на 150 px — переносятся второй строкой */
@media (min-width: 701px) and (max-width: 1100px) {
    .page-board .board-nav { flex-wrap: wrap; }
    .page-board .board-nav-info { flex: 1 1 auto; max-width: none; }
    .page-board .board-nav-tools { flex: 1 1 100%; justify-content: flex-end; margin-left: 0; }
}
