/* acc2-kit-shell — scrollbar, reset/shell, tokens, topbar, buttons, fields
   Layer of acc2-kit (TODO-079 Phase 3B). After acc2-tokens, before other kit layers.
   Карта: 0 scrollbar · 1 reset/shell · 2 tokens · 3 topbar/chips · 4 btn · 5 fields
*/

/* ============================================================
 * 0. Global scrollbar (весь ACC): одна полоса на всё — меню, страница, блоки, диалоги, окно ассистента
 * (его полоса страницы у колонки — .pagebar в widget.js, те же токены)
 * ============================================================ */
:root {
    --btn-muted-bg: #eef1f5;
    --btn-muted-hover-bg: #e4e8ee;
    --btn-muted-active-bg: #d8dde5;
    /* полупрозрачный: виден и на белом, и на сером, и на цветном фоне (свой тон у roko — acc2-project-roko.css) */
    --scroll-thumb: rgb(142 152 166 / 27%);
    --scroll-thumb-hover: rgb(142 152 166 / 45%);
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    border-radius: 99px;
    background-color: var(--scroll-thumb);
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--scroll-thumb-hover);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Стандартные свойства — только браузеру без ::-webkit-scrollbar (Firefox): в Chrome они отменяют правила выше
   и рисуют системную полосу со стрелками */
@supports not selector(::-webkit-scrollbar) {
    * {
        scrollbar-width: thin;
        scrollbar-color: var(--scroll-thumb) transparent;
    }
}

html,
body {
    scrollbar-gutter: stable;
}

@supports not (scrollbar-gutter: stable) {
    html {
        overflow-y: scroll;
    }
}

/* ============================================================
 * 1. Reset + shell (breadcrumb / notify)
 * ============================================================ */
.acc2, .acc2 *, .acc2 *::before, .acc2 *::after {
    box-sizing: border-box;
}

/* В реальном приложении .acc2 — div.page-shell внутри .page-center (header.php).
   Центрирование страницы — в acc2-base.css (.page-center); здесь только сброс box-sizing. */

/* Скрываем легаси-заголовок h1 и разделитель hr для acc2-страниц. */
div#main:has(.page-shell.acc2) > h1.title,
div#main:has(.page-shell.acc2) > hr {
    display: none;
}

/* Glass — :root: sticky-chrome и .primary-nav (меню вне .acc2). */
:root {
    --acc2-glass-bg: color-mix(in srgb, var(--nav-panel) 70%, transparent);
    --acc2-glass-border: color-mix(in srgb, var(--nav-line) 40%, transparent);
    --acc2-glass-blur: blur(12px);
}
.acc2 {
    --shadow-topbar: 0 10px 24px -14px rgba(28, 39, 51, 0.16);
    --r-card: 12px;
}

/* Один sticky-chrome: крошка (+ page-topbar из модуля, вырезанный в index.php).
   Glass/blur/рамка/скругление — только здесь; внутри фон прозрачный → нет шва и FOUC. */
.acc2 .page-sticky-chrome {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--acc2-glass-bg);
    border: 1px solid var(--acc2-glass-border);
    border-top: none;
    border-bottom: none;
    border-radius: 0 0 var(--r-card) var(--r-card);
    box-shadow: var(--shadow-topbar);
    backdrop-filter: var(--acc2-glass-blur);
    -webkit-backdrop-filter: var(--acc2-glass-blur);
}

.acc2 .page-breadcrumb {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 26px;
    font-size: 11px; font-weight: bold; color: var(--nav-muted);
    background: transparent;
    border: none;
    border-radius: 0;
    position: static;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    > i.fa-angle-right { font-size: 9px; opacity: .35; color: var(--nav-muted); }
    .share-link-btn {
        flex-shrink: 0; margin-right: 6px;
        width: 28px; height: 28px; padding: 0; justify-content: center;
        font-size: 12px;
        i { opacity: 1; color: var(--acc2-head-fg); font-size: 12px; }
        &.loading { pointer-events: none; opacity: 0.7; }
        &.loading i { animation: share-btn-spin 0.8s linear infinite; }
        &.success { background: var(--green); border-color: var(--green); color: var(--acc2-head-fg); }
        &.error { background: var(--nav-red); border-color: var(--nav-red); color: var(--acc2-head-fg); }
    }
    .page-breadcrumb-trail {
        display: flex; align-items: center; gap: 6px;
        flex: 1; min-width: 0;
    }
    .suggest-improvement-btn {
        flex-shrink: 0; margin-left: 0;
        font-size: 11px; font-weight: 600;
        i { font-size: 11px; }
    }
    /* Виджеты топбара (уведомления и ошибки страницы) — один компонент: иконка-триггер,
       бейдж-счётчик и выпадающая панель. Общее — в сгруппированных правилах ниже,
       различия — цвет иконки, размер и рамка панели, способ раскрытия. */
    .acc-notify-widget,
    .acc-page-errors-widget {
        position: relative; flex-shrink: 0; margin-left: 12px;
        font-size: 12px; font-weight: 400;
    }
    .acc-notify-widget .acc-notify-trigger,
    .acc-page-errors-widget .acc-page-errors-trigger {
        position: relative; width: 30px; height: 30px; min-height: 30px; padding: 0;
        justify-content: center; font-size: 12px;
    }
    .acc-notify-widget .acc-notify-trigger i { color: var(--nav-blue-deep); }
    .acc-page-errors-widget .acc-page-errors-trigger i { color: var(--nav-red); }
    .acc-notify-widget .acc-notify-badge,
    .acc-page-errors-widget .acc-page-errors-badge {
        position: absolute; top: -5px; right: -6px;
        min-width: 16px; height: 16px; padding: 0 4px;
        border: 2px solid var(--nav-panel); border-radius: 999px;
        background: var(--nav-red); color: var(--acc2-head-fg);
        font-size: 9px; line-height: 12px; text-align: center;
    }
    .acc-notify-widget .acc-notify-menu,
    .acc-page-errors-widget .acc-page-errors-popover {
        position: absolute; top: calc(100% + 8px); right: 0; overflow: hidden;
        border: 1px solid var(--nav-line); border-radius: var(--r-card);
        background: var(--nav-panel); box-shadow: var(--shadow-card);
        opacity: 0; pointer-events: none; transform: translateY(-4px);
        transition: opacity .15s ease, transform .15s ease;
    }
    .acc-notify-widget .acc-notify-menu { z-index: 80; width: 340px; }
    .acc-page-errors-widget .acc-page-errors-popover {
        z-index: 85; width: 320px; max-width: min(320px, 70vw);
        border-color: var(--chip-border-red);
    }
    /* Уведомления раскрываются по клику, ошибки — по наведению и фокусу */
    .acc-notify-widget.is-open .acc-notify-menu,
    .acc-page-errors-widget:hover .acc-page-errors-popover,
    .acc-page-errors-widget:focus-within .acc-page-errors-popover {
        opacity: 1; pointer-events: auto; transform: translateY(0);
    }
    .acc-notify-widget {
        .acc-notify-menu-head {
            display: flex; justify-content: space-between; align-items: center;
            padding: 10px 12px; border-bottom: 1px solid var(--nav-line);
            color: var(--nav-ink); font-size: 12px; font-weight: 700;
        }
        .acc-notify-menu-head-actions { display: flex; align-items: center; gap: 6px; }
        .acc-notify-menu-count {
            min-width: 20px; padding: 2px 6px; border-radius: 999px;
            background: var(--nav-blue-soft); color: var(--nav-blue-deep);
            font-size: 10px; text-align: center;
        }
        .acc-notify-filter {
            display: inline-flex; align-items: center; gap: 4px; margin-right: 4px;
            color: var(--nav-muted); font-size: 11px; font-weight: 600; cursor: pointer;
        }
        .acc-notify-items { max-height: 360px; overflow-y: auto; }
        .acc-notify-items.is-unread-only .acc-notify-item.is-read { display: none; }
        .acc-notify-item {
            display: flex; align-items: flex-start; gap: 9px;
            padding: 10px 12px; border-bottom: 1px solid var(--nav-line);
            color: var(--nav-ink); text-decoration: none;
            &:last-of-type { border-bottom: 0; }
            &:hover { background: var(--nav-blue-soft); }
            &.is-read { opacity: .7; }
        }
        .acc-notify-item-icon {
            display: flex; align-items: center; justify-content: center;
            width: 24px; height: 24px; flex: 0 0 24px;
            border-radius: 7px; background: var(--nav-blue-soft);
            color: var(--nav-blue-deep); font-size: 11px;
        }
        .acc-notify-item-body { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 3px; }
        .acc-notify-item-title {
            overflow: hidden; color: var(--nav-ink); font-size: 11px; font-weight: 700;
            text-overflow: ellipsis; white-space: nowrap;
        }
        .acc-notify-item-meta { color: var(--nav-muted); font-size: 10px; }
        .acc-notify-item-required, .notify-required-mark {
            color: var(--nav-red); font-size: 10px;
        }
        .acc-notify-empty { max-width: none; }
        .acc-notify-menu-foot {
            display: flex; flex-direction: column; align-items: center; gap: 6px;
            padding: 8px 12px; border-top: 1px solid var(--nav-line);
            text-align: center; font-size: 11px; font-weight: 600;
            a { display: inline-flex; align-items: center; gap: 6px; }
        }
    }
    .acc-page-errors-widget {
        .acc-page-errors-popover-head {
            padding: 10px 12px; border-bottom: 1px solid var(--nav-line);
            color: var(--nav-red); font-size: 12px; font-weight: 700;
        }
        .acc-page-errors-popover-list {
            margin: 0; padding: 8px 12px 10px 24px; max-height: 240px; overflow-y: auto;
            color: var(--nav-ink); font-size: 11px; line-height: 1.45;
            li + li { margin-top: 6px; }
            strong { color: var(--nav-red); font-weight: 700; }
        }
    }
}
.acc-page-errors-dialog > .info-block-red {
    margin-bottom: 12px;
}
.acc-notify-required-queue, .acc-notify-widget .is-hidden { display: none !important; }
.acc2 .notify-required-mark { margin-left: 5px; color: var(--nav-red); font-size: 10px; }

@media (min-width: 901px) {
    .ui-dialog.acc2:has(.notify-full-content),
    .ui-dialog.acc2:has(.improvement-full-content),
    .ui-dialog.acc2:has(.md-file-preview) {
        width: min(800px, calc(100% - 2 * var(--ui-dialog-pad-x, 8px))) !important;
        max-width: min(800px, calc(100% - 2 * var(--ui-dialog-pad-x, 8px)));
    }
}
.acc2 .md-file-preview {
    padding: 4px 8px 12px;
    max-height: min(70vh, 720px);
    overflow: auto;
    /* Не наследовать body 12px — как improvement-full-body */
    font-size: 15px;
    line-height: 1.55 !important;
    color: var(--nav-ink);
}
.acc2 .notify-full-content,
.acc2 .improvement-full-content {
    padding: 4px 8px 12px;
    color: var(--nav-ink);
    .notify-full-head,
    .improvement-full-head {
        padding-bottom: 14px;
        border-bottom: 1px solid var(--nav-line);
    }
    .notify-full-meta,
    .improvement-full-meta {
        display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
        min-height: 34px; color: var(--nav-muted); font-size: 11px;
    }
    .improvement-full-meta-extra { min-height: 0; margin-top: 6px; }
    .notify-full-type-icon {
        display: inline-flex; align-items: center; justify-content: center;
        width: 34px; height: 34px; flex: 0 0 34px;
        border-radius: 10px; background: var(--nav-blue-soft);
        font-size: 15px;
        i { font-size: 15px; }
    }
    .notify-full-author,
    .improvement-full-author { font-weight: 600; }
    .notify-full-date,
    .improvement-full-date { margin-left: auto; white-space: nowrap; }
    .notify-full-title,
    .improvement-full-title {
        margin: 13px 0 0; color: var(--nav-ink);
        font-size: 24px; line-height: 1.2; font-weight: 700;
        word-break: break-word;
    }
    /* Переписка по запросу: сообщения исполнителя слева, автора — с отступом и синим фоном */
    .improvement-thread {
        margin-top: 18px; padding-top: 14px;
        border-top: 1px solid var(--nav-line);
    }
    .improvement-thread-title { margin: 0 0 10px; font-size: 15px; font-weight: 700; }
    .improvement-msg {
        margin: 0 48px 10px 0; padding: 9px 12px;
        border: 1px solid var(--nav-line); border-radius: 10px;
        /* Сообщения исполнителя и «Разработки» — бледно-голубые в обоих контурах (--blue-pale у roko кремовый) */
        background: color-mix(in srgb, var(--acc2-state-info-soft) 35%, var(--nav-panel));
    }
    .improvement-msg--author { margin: 0 0 10px 48px; background: var(--nav-blue-soft); }
    .improvement-msg-meta {
        display: flex; align-items: center; gap: 9px;
        color: var(--nav-muted); font-size: 11px;
        time { margin-left: auto; white-space: nowrap; }
    }
    /* Значок удаления — стандартный .row-act a; строку автора и времени он не раздвигает */
    .improvement-msg-delete { display: inline-flex; margin: -6px 0; }
    /* Кнопка «Переписка N» в шапке карточки: до блока переписки не листать */
    .improvement-thread-btn { gap: 6px; }
    .improvement-reply-form { margin-top: 14px; }
    .improvement-reply-form textarea { width: 100%; resize: vertical; }
    .improvement-reply-wait {
        display: inline-flex; align-items: center; gap: 6px;
        margin: 8px 14px 0 0; font-size: 12px;
    }
    .notify-full-body,
    .improvement-msg-body,
    .improvement-full-body {
        padding: 18px 2px 4px;
        color: var(--nav-ink); font-size: 15px; line-height: 1.55;
        overflow-wrap: anywhere;
        p { margin: 0 0 10px; }
        p:last-child { margin-bottom: 0; }
        ul:not(.md-toc-list), ol {
            margin: 4px 0 12px; padding-left: 1.35em;
        }
        ul:not(.md-toc-list) { list-style: disc; }
        ol { list-style: decimal; }
        li { margin: 0 0 6px; padding: 0; }
        li:last-child { margin-bottom: 0; }
        p + ul:not(.md-toc-list), p + ol { margin-top: 4px; }
        ul:not(.md-toc-list) + p, ol + p { margin-top: 16px; }
        h1, h2, h3, h4 {
            margin: 16px 0 8px; font-weight: 700; line-height: 1.25; color: var(--nav-ink);
        }
        h1 { font-size: 1.35em; }
        h2 { font-size: 1.2em; }
        h3, h4 { font-size: 1.05em; }
        blockquote {
            margin: 8px 0 12px; padding: 4px 0 4px 12px;
            border-left: 3px solid var(--nav-line); color: var(--nav-muted);
        }
        code {
            padding: 1px 5px; border-radius: 4px;
            background: var(--nav-blue-soft); font-size: 0.9em;
        }
        pre {
            margin: 8px 0 12px; padding: 10px 12px; overflow: auto;
            border-radius: 8px; background: var(--nav-blue-soft);
        }
        pre code { padding: 0; background: none; }
        a { color: var(--nav-blue); }
        img { max-width: 100%; height: auto; }
        hr { margin: 16px 0; border: 0; border-top: 1px solid var(--nav-line); }
    }
    .improvement-msg-body { padding: 6px 0 0; font-size: 14px; }
}
/* Список «Улучшений»: значок переписки со счётчиком сообщений */
.acc2 .improvement-msg-count { display: inline-flex; align-items: center; gap: 5px; }

/* Markdown body: таблицы и оглавление */
.acc2 .md-body {
    overflow-x: auto;
    h1, h2, h3, h4, h5, h6 { scroll-margin-top: 10px; }
    table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
        margin: 12px 0 16px;
        font-size: 13px;
        line-height: 1.4;
        border: 1px solid var(--nav-line);
        border-radius: var(--r-card);
        thead tr:first-child {
            th:first-child { border-top-left-radius: var(--acc2-head-radius); }
            th:last-child { border-top-right-radius: var(--acc2-head-radius); }
        }
        tbody tr:last-child {
            td { border-bottom: 0; }
            td:first-child { border-bottom-left-radius: calc(var(--r-card) - 1px); }
            td:last-child { border-bottom-right-radius: calc(var(--r-card) - 1px); }
        }
        tbody tr:nth-child(odd) > td { background-color: var(--nav-panel); }
        tbody tr:nth-child(even) > td { background-color: var(--blue-pale); }
        tbody tr:hover > td { background-color: var(--nav-orange-soft); }
    }
    th, td {
        border: 0;
        border-bottom: 1px solid var(--nav-line-soft);
        padding: 8px 10px;
        text-align: left;
        vertical-align: top;
    }
    thead th {
        background: var(--nav-blue-soft);
        font-weight: 700;
        color: var(--nav-ink);
    }
    .md-toc {
        margin: 0 0 18px;
        padding: 12px 14px;
        border: 1px solid var(--nav-line);
        border-radius: 10px;
        background: color-mix(in srgb, var(--nav-blue-soft) 55%, #fff);
    }
    .md-toc-title {
        margin: 0 0 8px;
        font-size: 12px;
        font-weight: 700;
        color: var(--nav-muted);
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }
    .md-toc-list {
        margin: 0;
        padding: 0;
        list-style: none;
        max-height: min(280px, 40vh);
        overflow: auto;
        font-size: 0.9em;
    }
    .md-toc-list li { margin-bottom: 4px; list-style: none; }
    .md-toc-list li:last-child { margin-bottom: 0; }
    .md-toc-list a {
        color: var(--nav-blue);
        text-decoration: none;
    }
    .md-toc-list a:hover { text-decoration: underline; }
    .md-toc-list li.md-toc-l2 { margin-left: 1.25em; }
    .md-toc-list li.md-toc-l3 { margin-left: 2.5em; font-size: 0.95em; }
}
/* Компактный текст документации (справка, руководство — длинный текст страницей, а не сообщение):
   13px вместо 15px текстового блока уведомления. Заголовки, код и оглавление заданы в em — уменьшаются
   пропорционально. Вес равен правилу .notify-full-content .notify-full-body (блок стоит внутри него) —
   побеждает порядком: держать это правило ниже того. */
.acc2 .md-body.md-body--compact {
    font-size: 13px;
    line-height: 1.5;
}
.acc2 .notify-type-arrival { color: var(--green); }
.acc2 .notify-type-delay { color: var(--nav-orange-active); }
.acc2 .notify-type-common { color: var(--nav-blue); }
.acc2 .notify-type-system { color: #7e57c2; }
.acc2 .notify-type-important { color: var(--nav-red); }
@keyframes share-btn-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Нет page-topbar в chrome — отступ под стеком */
.acc2 .page-sticky-chrome:not(:has(> .page-topbar)) {
    margin-bottom: 20px;
}

/* ============================================================
 * 2–5. Tokens + topbar + buttons + fields (.acc2)
 * ============================================================ */
.acc2 {
    --green: #1a8f4c;
    --green-soft: #e7f7ee;
    --blue-pale: #f4f9fe;
    /* Наведение на строку таблицы (grid-table, раскрытие, отчёт, summary-table); тема контура меняет токен, не правила */
    --row-hover: var(--nav-orange-soft);

    --r-panel: 9px;
    --r-control: 7px;
    --r-pill: 999px;

    /* Максимальная ширина контента — глобальный токен :root (--acc2-page-max). */
    /* --r-card / --shadow-topbar / --acc2-glass-* — выше, до .page-breadcrumb */

    --shadow-card: rgb(28 39 51 / 16%) 6px 6px 10px -3px, rgb(152 165 180) -2px -2px 10px -6px;
    --shadow-btn: rgba(28, 39, 51, 0.16) 1px 3px 7px -2px;

    /* Общий стиль «синей шапки» (как .summary-money / блок «Итого»). */
    --acc2-head-bg: linear-gradient(175deg, #1965b0 0%, #66a8eb 100%);
    --acc2-head-fg: #fff;
    --acc2-head-sort: var(--nav-orange-active);
    --acc2-head-sorter: rgb(161 217 247 / 88%);
    --acc2-head-text-shadow: 1px 1px 1px var(--nav-ink);
    --acc2-head-radius: calc(var(--r-card) - 1px);

    /* chip borders / wait — чуть темнее --nav-*-soft */
    --chip-border-orange: #f4d9b7; --chip-border-red: #f1cdcd; --chip-border-green: #bfe3cd;
    --chip-border-info: #a2c4e8; --chip-border-wait: #e0cbb3; --chip-border-neutral: #b4bec8;
    /* st-wait: коричневый (раньше был зелёный и сливался с st-ok) */
    --chip-wait-bg: #f3ebe4; --chip-wait-fg: #7a4a22;
    /* st-value: значение данных — холодный светлый фон, виден и на белом, и на тёплых строках roko */
    --chip-value-bg: #e8f0f8; --chip-border-value: #bccbdc;
    --acc2-state-info: #0a84ff; --acc2-state-info-soft: #d6ebff;
    --acc2-state-wait: #8a5a2b;

    /* .btn / .field-* / .ms-* / filter / portal .ms-dropdown */
    --btn-blue-border: #bfdaf5; --btn-blue-hover-bg: #d8ebfd; --btn-blue-active-bg: #c7e0fa; --btn-blue-fg: #004891;
    --btn-muted-border: #d5dbe3; --btn-muted-fg: #5c6878;
    --btn-h: 34px; --btn-h-sm: 30px; --btn-pad-x: 14px; --btn-pad-x-sm: 11px;
    --btn-shadow: 0 2px 7px -1px rgb(54 80 106 / 28%);
    --btn-shadow-hover: 0 4px 11px -1px rgb(86 125 164 / 38%);
    --btn-shadow-active: 0 1px 4px -1px rgba(0, 95, 189, 0.28);
    --input-bg: #f5f7fb; --input-hover-border: #c9d5e3;
    --input-shadow: inset 2px 2px 5px -3px rgb(157 157 157 / 29%);

    /* field box (.field-input + .f-field + .ms-field) */
    --field-h: 34px; --field-pad-x: 12px; --field-border: 1px solid var(--nav-line);
    --field-radius: var(--r-control); --field-bg: var(--input-bg); --field-fg: var(--nav-ink);
    --field-shadow: var(--input-shadow);
    --field-transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;

    /* grid-table thead modes via --gt-head-* (list / TableEdit / status-log) */
    --gt-head-bg: var(--nav-blue-soft); --gt-head-fg: var(--btn-blue-fg); --gt-head-position: sticky;
    --gt-head-pad: 10px 6px 5px; --gt-head-fs: 11px; --gt-head-fw: bold;
    --gt-head-border-bottom: 2px solid var(--nav-line); --gt-head-text-shadow: var(--text-shadow-heading);

    /* status-chip base sizes (compact — в правиле --sm / grid-table) */
    --chip-h: 26px; --chip-pad-x: 11px; --chip-fs: 12.5px; --chip-fw: bold;
    --chip-gap: 7px; --chip-ico: inherit; --chip-dot: 7px;

    --acc2-info-label-icon: var(--nav-blue);
    --acc2-breadcrumb-h: 0px; --acc2-table-sticky-top: 0px; /* sticky: acc2-sticky.js */

    /* Legacy: без .page-topbar — padding на контейнере.
       .page-content полноширинный (гутер 26px); --acc2-page-max — у .page-body--pane / topbar.
       Списковые таблицы width:100% не режем; справочники с width:auto — отдельный archetype. */
    .page-content {
        width: 100%;
        box-sizing: border-box;
    }
    /* Паддинг на .page-content — только без list/split и без topbar в sticky-chrome */
    &:not(:has(> .page-sticky-chrome > .page-topbar)) > .page-content:not(:has(> .page-body--list)):not(:has(> .page-body--split)) {
        padding: 0 26px 60px;
    }

    /* Ссылки: базовый цвет для всех; hover-фон — .text-link / .file-icon-link (opt-in). */
    a {
        color: var(--nav-blue-deep);
        text-decoration: none;
        transition: color .15s ease, background .15s ease;
        &:hover { color: var(--nav-blue); }
    }
    .text-link {
        padding: 3px 6px;
        margin: -3px -6px;
        border-radius: 5px;
        &:hover { background: var(--nav-line-soft); }
    }
    /* Адрес в комментарии (фильтр TEXT_HTML): длинный переносится где угодно, не распирает блок */
    .text-url {
        overflow-wrap: anywhere;
        &:hover { text-decoration: underline; }
    }
    /* Компактный ряд иконок файлов (filesClass::getFileListShort) — hover как у text-link */
    .file-icons {
        display: inline-flex;
        align-items: center;
        flex-wrap: wrap;
    }
    .file-icon-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 2px 3px;
        border-radius: 5px;
        line-height: 1;
        &:hover { background: var(--nav-line-soft); }
    }
    .file-links {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    /* ===== 2. Topbar / заголовки / meta / статус-чипы ===== */
    .page-topbar {
        position: static;
        margin: 0;
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        padding: 12px 26px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;

        h1 { margin: 0; font-size: 17px; .num { color: var(--nav-ink); } }
    }
    .tb-back {
        width: 34px; height: 34px; border-radius: 50%; background: var(--nav-blue-soft); color: var(--nav-blue-deep);
        display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
        &:hover { background: var(--nav-blue); color: var(--acc2-head-fg); }
    }
    .tb-title-wrap { display: flex; flex-direction: column; gap: 4px; }
    .tb-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
    .type-word { font-weight: bold; }
    .tw-preorder { color: var(--nav-blue); }
    .tw-order { color: var(--nav-ink); }
    .tw-warranty { color: var(--nav-orange-active); }
    .tw-dropship { color: var(--green); }
    .tw-supply { color: var(--nav-blue); }
    .tb-meta {
        color: var(--nav-muted); font-size: 12px; display: inline-flex; align-items: center;
        > i { margin-right: 5px; }
        b { color: var(--nav-ink); }
        /* Несколько телефонов (formatData::phoneAddMsgrsLink) разделены <br> — в строке шапки он не
           переносит, номера склеивались; здесь между ними точка, как между остальными данными */
        > br { display: none; }
        > .phone-cell + br + .phone-cell::before { content: ''; display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--nav-muted); margin: 0 8px; opacity: .6; }
    }
    .dot-sep { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--nav-muted); margin: 0 8px; opacity: .6; }
    .status-chip {
        --_chip-h: var(--chip-h); --_chip-pad-x: var(--chip-pad-x); --_chip-fs: var(--chip-fs);
        --_chip-fw: var(--chip-fw); --_chip-gap: var(--chip-gap); --_chip-ico: var(--chip-ico); --_chip-dot: var(--chip-dot);
        display: inline-flex; align-items: center; gap: var(--_chip-gap); height: var(--_chip-h); padding: 0 var(--_chip-pad-x);
        border-radius: var(--r-pill); border-width: 1px; border-style: solid; font-size: var(--_chip-fs); font-weight: var(--_chip-fw);
        flex: 0 0 auto; white-space: nowrap; text-shadow: none;
        i { font-size: var(--_chip-ico); }
        .status-dot { width: var(--_chip-dot); height: var(--_chip-dot); }
        &.st-progress { background: var(--nav-orange-soft); border-color: var(--chip-border-orange); color: var(--nav-orange-active); }
        &.st-wait { background: var(--chip-wait-bg); border-color: var(--chip-border-wait); color: var(--chip-wait-fg); }
        &.st-ok { background: var(--green-soft); border-color: var(--chip-border-green); color: var(--green); }
        &.st-neutral { background: var(--nav-line-soft); border-color: var(--chip-border-neutral); color: var(--nav-muted); }
        /* Значение данных, не статус (перечень названий, значения характеристики, артикулы): читаемый текст, не «выключено» */
        &.st-value { background: var(--chip-value-bg); border-color: var(--chip-border-value); color: var(--nav-ink); }
        &.st-type-order { background: #5a6b7d; border-color: #7a8fa3; color: #f0f4f8; }
        &.st-info { background: var(--nav-blue-soft); border-color: var(--chip-border-info); color: var(--nav-blue-deep); }
        &.st-cancel { background: var(--nav-red-soft); border-color: var(--chip-border-red); color: var(--nav-red); }
        &.st-sell { background: #f3e8fa; border-color: #d9b8e8; color: #9e00c3; }
        &.st-hopeless { background: #ece1e1; border-color: #d9baba; color: #7a3b3b; }
        /* Накопительная скидка: тепловая шкала серый → бледный оранжевый → мягкий зелёный */
        &.st-vol-0 { background: #ececec; border-color: #c8c8c8; color: #6a6a6a; }
        &.st-vol-1 { background: #ffe0c2; border-color: #f0b078; color: #c46a18; }
        &.st-vol-2 { background: #f3efb8; border-color: #d4c86a; color: #7a7218; }
        &.st-vol-3 { background: #dceeb8; border-color: #a8c868; color: #4a7020; }
        &.st-vol-4 { background: #c8e8d4; border-color: #7eb89a; color: #1a6b44; }
        &.st-exclusive { background: #fff4cc; border-color: #e0b84a; color: #9a7200; }
        /* compact: --sm и строки списка */
        &.status-chip--sm,
        table.grid-table & {
            --_chip-h: 20px; --_chip-pad-x: 7px; --_chip-fs: 11px; --_chip-fw: normal;
            --_chip-gap: 5px; --_chip-ico: 10px; --_chip-dot: 5px;
        }
    }
    .status-dot { width: var(--chip-dot); height: var(--chip-dot); border-radius: 50%; background: currentColor; }
    .status-chip-row { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
    /* Образец цвета значения характеристики (TODO-051): цвет из данных — переменной style="--swatch: #c62828" */
    .color-swatch { display: inline-block; flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%; vertical-align: -2px;
        background: var(--swatch, var(--nav-line-soft)); border: 1px solid var(--chip-border-neutral); }
    /* Кнопки — только внутри .action-toolbar (как clients/full). Spacer в разметке
       оставлен для совместимости; вправо жмёт margin-left:auto у тулбара. */
    .tb-spacer { display: none; }
    .page-topbar .action-toolbar {
        margin-left: auto;
        max-width: 100%;
        justify-content: flex-end;
    }

    /* ===== 3. Кнопки (.btn*) / тулбар действий ===== */
    .action-toolbar { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; position: relative; }
    .toolbar-group { display: inline-flex; align-items: center; gap: 7px; }
    .toolbar-group-anchor { position: relative; display: inline-flex; align-items: center; }
    .toolbar-group + .toolbar-group::before {
        content: ""; width: 1px; height: 20px; background: var(--nav-line); margin: 0 4px; align-self: center;
    }

    .btn {
        display: inline-flex; align-items: center; gap: 7px; height: var(--btn-h); padding: 0 var(--btn-pad-x);
        border-radius: var(--r-control); border: 1px solid var(--btn-blue-border);
        background: var(--nav-blue-soft); color: var(--btn-blue-fg);
        font-size: 12.5px; font-weight: bold; cursor: pointer;
        box-shadow: var(--btn-shadow);
        transition: box-shadow .15s, transform .1s, filter .15s, background .15s; white-space: nowrap;

        &:hover { background: var(--btn-blue-hover-bg); color: var(--btn-blue-fg); box-shadow: var(--btn-shadow-hover); transform: translateY(-1px); text-decoration: none; }
        &:active { transform: translateY(0); box-shadow: var(--btn-shadow-active); background: var(--btn-blue-active-bg); }
        &:disabled, &.disabled {
            opacity: .55;
            filter: grayscale(.4);
            pointer-events: none;
            cursor: default;
            transform: none;
            box-shadow: none;
        }
        i { font-size: 12px; }
    }

    /* Сплошные варианты: color/border-color стабильны; hover-hex без токена — намеренно */
    .btn-primary {
        color: var(--acc2-head-fg); border-color: var(--nav-blue-deep);
        background: var(--nav-blue); box-shadow: 0 3px 10px -2px rgba(0,95,189,.5);
        &:hover { background: #1a78d0; color: var(--acc2-head-fg); box-shadow: 0 5px 14px -2px rgba(0,95,189,.6); }
        &:active { background: var(--nav-blue-deep); }
    }

    .btn-go {
        color: var(--acc2-head-fg); border-color: #147a3e;
        background: var(--green); box-shadow: 0 3px 10px -2px rgba(26,143,76,.5);
        &:hover { background: #219654; color: var(--acc2-head-fg); box-shadow: 0 5px 14px -2px rgba(26,143,76,.6); }
        &:active { background: #147a3e; }
    }

    .btn-danger {
        color: var(--acc2-head-fg); border-color: #a32424;
        background: var(--nav-red); box-shadow: 0 3px 10px -2px rgba(198,40,40,.5);
        &:hover { background: #d33636; color: var(--acc2-head-fg); box-shadow: 0 5px 14px -2px rgba(198,40,40,.6); }
        &:active { background: #a32424; }
    }

    /* Приглушённая серая — вторичные действия */
    .btn-secondary, .btn-muted {
        color: var(--btn-muted-fg); border-color: var(--btn-muted-border);
        background: var(--btn-muted-bg); box-shadow: 0 2px 7px -1px rgb(90 102 120 / 16%);
        &:hover { background: var(--btn-muted-hover-bg); color: var(--btn-muted-fg); box-shadow: 0 4px 11px -1px rgb(90 102 120 / 22%); }
        &:active { background: var(--btn-muted-active-bg); box-shadow: 0 1px 4px -1px rgb(90 102 120 / 18%); }
    }

    .btn-icon { width: var(--btn-h); padding: 0; justify-content: center; }
    .btn-sm { height: var(--btn-h-sm); padding: 0 var(--btn-pad-x-sm); font-size: 12px; font-weight: normal; }

    /* ===== 4. Поля форм (input/select/field-*), mSelect-поле ===== */
    /* ---------- Поля форм: input/select ----------
       Два способа навешивания одной и той же "коробки" — класс прямо на поле
       (.field-input/.field-select, обычные формы add/edit) либо обёртка .f-field
       (компактные панели фильтров, см. sandbox/filter-variant-a-popover.html).
       mSelect (jquery.mselect.js) — отдельно ниже; .ms-dropdown портируется плагином
       в document.body, поэтому его стили вынесены за пределы .acc2 (см. низ файла). */
    /* .field-label { display: block; font-size: 12px; font-weight: bold; color: var(--nav-ink); margin-bottom: 6px; } */
    .field-label, .f-field > label {
        display: block; margin-bottom: 5px; font-size: 11px; font-weight: bold; color: var(--nav-muted);
        text-transform: uppercase; letter-spacing: .02em;
    }

    /* Коробка поля: класс на input (.field-*) и фильтры (.f-field …) — одни --field-* */
    .field-input, .field-select, .field-file,
    .f-field input[type="text"], .f-field input[type="date"], .f-field select:not([data-mselect]) {
        max-width: 100%; height: var(--field-h); padding: 0 var(--field-pad-x);
        border: var(--field-border); border-radius: var(--field-radius);
        background: var(--field-bg); font: inherit; color: var(--field-fg); outline: none;
        box-shadow: var(--field-shadow); transition: var(--field-transition);
        &::placeholder { color: var(--nav-muted); }
    }
    .field-input[type="number"]::-webkit-inner-spin-button {
        margin: 2px 2px 2px 0;
        height: 20px;
    }
    .field-file { height: 50px; padding: 15px; }
    /* Ширины: default 150px + shortText…xlText — в acc2-base.css.
       В .filter-grid перекрываются width:100%. */
    /* Полный border (не только border-color) на hover — иначе ширина/стиль рамки может
       унаследоваться от другого правила и рамка визуально "пропадает". */
    .field-input:hover, .field-select:hover, .field-file:hover,
    .f-field input[type="text"]:hover, .f-field input[type="date"]:hover, .f-field select:not([data-mselect]):hover,
    .ui-daterange:hover, .ms-wrap .ms-field:hover {
        border: 1px solid var(--input-hover-border); background: var(--input-bg);
    }
    /* focus (+ :hover:focus чтобы перебить :hover); .is-focus — демо в тулките.
       Не .f-field input:focus — чекбокс/радио тоже матчились, белый фон прятал галочку. */
    .field-input:focus, .field-select:focus, .field-file:focus, .field-input.is-focus, .field-select.is-focus,
    .f-field input:not([type="checkbox"]):not([type="radio"]):focus, .f-field select:focus, .ui-daterange:focus-within,
    .field-input:hover:focus, .field-select:hover:focus, .field-input.is-focus:hover, .field-select.is-focus:hover,
    .f-field input[type="text"]:hover:focus, .f-field input[type="date"]:hover:focus,
    .f-field select:not([data-mselect]):hover:focus {
        border: 1px solid var(--nav-blue); background: var(--nav-panel); box-shadow: 0 0 0 3px var(--nav-blue-soft);
    }
    .field-input:disabled, .field-select:disabled, .field-file:disabled {
        background: var(--nav-line-soft); color: var(--nav-muted); border-color: var(--nav-line); cursor: not-allowed;
    }

    /* * обязательного поля; на тёмной шапке — оранжевый */
    .field-req { color: var(--nav-red); font-weight: 700; text-decoration: none; cursor: help; margin-left: 2px; }
    :is(.card-head, table.grid-table thead th) .field-req { color: var(--nav-orange); }
    .field-input.has-error, .field-select.has-error, .field-file.has-error,
    .field-input.error, .field-select.error, .field-file.error { border-color: var(--nav-red); }
    .field-input.has-error:focus, .field-select.has-error:focus, .field-file.has-error:focus,
    .field-input.error:focus, .field-select.error:focus, .field-file.error:focus { box-shadow: 0 0 0 3px var(--nav-red-soft); }
    .field-hint { display: flex; align-items: center; gap: 4px; margin-top: 5px; font-size: 11px; color: var(--nav-muted); }
    .field-hint.error { color: var(--nav-red); }
    .field-hint--inline { display: inline; margin-top: 0; margin-left: 10px; vertical-align: middle; }

    textarea.field-input {
        height: auto; min-height: 95px; padding: 8px 12px; resize: vertical;
    }
    .field-input.datepicker.date { width: 112px; text-align: left; }

    /* .ui-daterange — chrome закрытого range-поля (flatpickr).
       filter: только ширина в .f-field + f-active; ui-shim: proxy/absolute internals. */
    .ui-daterange {
        display: inline-flex;
        align-items: center;
        justify-content: space-between;
        gap: 2px;
        padding: 0 4px;
        height: var(--field-h);
        border: var(--field-border);
        border-radius: var(--field-radius);
        background: var(--field-bg);
        box-shadow: var(--field-shadow);
        cursor: pointer;
        color: var(--field-fg);
        transition: var(--field-transition);
        box-sizing: border-box;
    }
    .ui-daterange.is-filled { color: var(--nav-ink); }
    .ui-daterange-field {
        flex: 0 0 auto;
        width: 9ch;
        min-width: 0;
        font: inherit;
        font-size: 12px;
        text-align: center;
        color: inherit;
        cursor: text;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
        outline: none;
    }
    .ui-daterange-field:hover,
    .ui-daterange-field:focus {
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }
    .ui-daterange-center {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
    }
    .ui-daterange-sep { flex: 0 0 auto; color: var(--nav-muted); font-size: 12px; }
    .ui-daterange-ico { font-size: 11px; flex: 0 0 auto; color: var(--nav-muted); transition: color .15s; }
    .ui-daterange:hover .ui-daterange-ico { color: var(--nav-blue); }
    .ui-daterange-nav {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 20px;
        height: 20px;
        padding: 0;
        border: 0;
        background: transparent;
        border-radius: var(--field-radius);
        color: var(--nav-muted);
        cursor: pointer;
        font-size: 10px;
        flex: 0 0 auto;
        transition: color .15s, background .15s;
    }
    .ui-daterange-nav:hover { color: var(--nav-blue); background: var(--nav-blue-soft); }
    .ui-daterange-next { margin-left: auto; }
    .ui-daterange-proxy {
        position: absolute;
        width: 0;
        height: 0;
        padding: 0;
        border: 0;
        opacity: 0;
        pointer-events: none;
    }

    .field-icon-wrap { position: relative; }
    .field-icon-wrap > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--nav-muted); font-size: 13px; pointer-events: none; }
    .field-icon-wrap .field-input { padding-left: 34px; }
    .field-stack { display: flex; flex-direction: column; gap: 14px; }
    /* Поле и кнопка к нему в одну строку (ключ / ссылка + «Скопировать»): поле тянется, кнопка — по тексту;
       поле с классом ширины (shortText…) — своей ширины */
    .field-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
    .field-row > .field-input:not([class*="Text"]) { flex: 1 1 auto; min-width: 0; }
    .field-row > .btn { flex: none; }

    /* Native select (base-select + ::picker). ::checkmark — на <option>, не на <select>.
       appearance только на <select> — .ms-field тоже .field-select (ширина/коробка). */
    :is(select.field-select, .f-field select:not([data-mselect])),
    :is(select.field-select, .f-field select:not([data-mselect]))::picker(select) { appearance: base-select; }
    :is(.field-select, .f-field select:not([data-mselect])) {
        display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; vertical-align: middle;
        /* UA base-select ставит field-sizing:content !important — ширина пляшет по option; фиксируем */
        field-sizing: fixed !important;
        min-width: 0;
        white-space: nowrap;
    }
    /* Закрытый select: длинная подпись (реквизиты) иначе рисуется за рамкой.
       ::selectedcontent в Chrome не создаётся, эллипсис — на самом select. */
    :is(select.field-select, .f-field select:not([data-mselect])) {
        overflow: hidden;
        text-overflow: ellipsis;
    }
    :is(select.field-select, .f-field select:not([data-mselect]))::selectedcontent,
    :is(select.field-select, .f-field select:not([data-mselect])) selectedcontent {
        flex: 1 1 0;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    :is(select.field-select, .f-field select:not([data-mselect])):open {
        background: var(--nav-panel); border-color: var(--nav-blue); box-shadow: 0 0 0 3px var(--nav-blue-soft);
    }
    :is(select.field-select, .f-field select:not([data-mselect]))::picker-icon,
    .ms-wrap .ms-arrow {
        flex: 0 0 auto; color: var(--nav-muted); font-size: 10px; line-height: 1;
        transition: rotate .15s ease, color .15s ease;
    }
    :is(select.field-select, .f-field select:not([data-mselect]))::picker-icon,
    .ms-wrap .ms-arrow::after { content: "\25BC"; }
    :is(select.field-select, .f-field select:not([data-mselect])):open::picker-icon,
    .ms-wrap.ms-open .ms-arrow, .ms-wrap.ms-open-above .ms-arrow { rotate: 180deg; color: var(--nav-blue); }
    :is(select.field-select, .f-field select:not([data-mselect]))::picker(select) {
        /* border / radius / shadow / bg — acc2-base.css (эталон: дата) */
        padding: 6px; margin: 4px 0 0; max-height: 260px; max-block-size: 260px; overflow-y: auto;
        /* ::-webkit-scrollbar (раздел 0) в ::picker не проходит — без этого системная полоса со стрелками */
        scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent;
        /* Список — по самому длинному option; не уже закрытого select */
        width: max-content;
        min-width: anchor-size(width);
        position-area: block-end span-inline-end; /* acc2DropdownPlacement → data-picker-above */
        position-try-fallbacks: none;
    }
    :is(.field-select, .f-field select:not([data-mselect]), .edit-form-container select:not([data-mselect]))[data-picker-above]::picker(select) {
        position-area: block-start span-inline-end; position-try-fallbacks: none; margin: 0 0 4px;
    }
    :is(.field-select, .f-field select:not([data-mselect])) option {
        padding: 7px 10px; border-radius: var(--r-control); font-size: 12.5px; outline: none;
    }
    :is(.field-select, .f-field select:not([data-mselect])) option:is(:hover, :focus, :focus-visible) {
        background: var(--nav-blue-pale); color: var(--nav-ink); outline: none;
    }
    :is(.field-select, .f-field select:not([data-mselect])) option:checked {
        background: var(--nav-blue-soft); font-weight: bold; color: var(--nav-blue-deep);
    }
    :is(.field-select, .f-field select:not([data-mselect])) option:checked:is(:hover, :focus, :focus-visible) {
        background: var(--nav-blue-soft); color: var(--nav-blue-deep);
    }
    :is(.field-select, .f-field select:not([data-mselect])) option::checkmark { display: none; }

    /* ---------- mSelect (includes/jq/jquery.mselect.js) ----------
       Поле (.ms-wrap/.ms-field) остаётся рядом со скрытым select внутри .acc2 — переменные
       читаются как обычно, без фолбэков. Выпадающий список плагин портирует в document.body
       (см. self.$portalRoot в jquery.mselect.js) — portal в acc2-kit-mselect.css.
       Поле (.ms-wrap/.ms-field) — здесь; в JS встроенных стилей нет. */
    /* FOUC: нативный multi-select прячем; .element без .ms-wrap — заглушка размера .ms-field. */
    select[data-mselect] {
        position: absolute !important;
        visibility: hidden;
        pointer-events: none;
        width: 100%;
        height: var(--field-h);
        max-height: var(--field-h);
    }
    .element:has(> select[data-mselect]):not(:has(> .ms-wrap)) {
        display: block;
        position: relative;
        box-sizing: border-box;
        height: var(--field-h);
        border: var(--field-border);
        border-radius: var(--field-radius);
        background: var(--field-bg);
        box-shadow: var(--field-shadow);
    }
    .f-field .element:has(> select[data-mselect]) { width: 100%; }
    .element:has(> select[data-mselect]):not(:has(> .ms-wrap))::after {
        content: "\25BC";
        position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
        color: var(--nav-muted); font-size: 10px; line-height: 1; pointer-events: none;
    }
    .ms-wrap { position: relative; display: inline-block; vertical-align: middle; }
    .f-field .ms-wrap { width: 100% !important; }
    .ms-wrap .ms-field { overflow: hidden; cursor: pointer; user-select: none; max-width: none; }
    .ms-wrap .ms-field-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .ms-wrap .ms-field--empty .ms-field-text { color: var(--nav-muted); }
    .ms-wrap .ms-arrow { pointer-events: none; }
    /* Открытое/focus-состояние — как у обычного input:focus (синий бордюр + мягкое свечение) */
    .ms-wrap.ms-open .ms-field, .ms-wrap.ms-open-above .ms-field {
        border: 1px solid var(--nav-blue) !important; background: var(--nav-panel) !important; border-radius: var(--r-control) !important;
        box-shadow: none !important;
    }
    .ms-wrap.ms-open, .ms-wrap.ms-open-above { box-shadow: 0 0 0 3px var(--nav-blue-soft); border-radius: var(--r-control); }
    .ms-wrap.ms-open .ms-field:hover, .ms-wrap.ms-open-above .ms-field:hover {
        border: 1px solid var(--nav-blue) !important; background: var(--nav-panel) !important;
    }
    /* Легаси-индикатор изменённого поля (.element.changed-data) — оранжевая стрелка. */
    .element.changed-data .ms-arrow { color: var(--nav-orange); }

    .more-menu {
        position: absolute; top: calc(100% + 4px); z-index: 20;
        min-width: 210px; padding: 6px;
        background: var(--nav-panel); border: 1px solid var(--nav-line); border-radius: var(--r-panel);
        box-shadow: var(--shadow-card);
        opacity: 0; visibility: hidden; pointer-events: none;
        transform: scale(.97) translateY(-6px); transform-origin: top right;
        transition: opacity .11s ease-in, transform .11s ease-in, visibility 0s linear .11s;

        &.open {
            opacity: 1; visibility: visible; pointer-events: auto; transform: none;
            transition: opacity .12s ease-out, transform .12s ease-out;
        }
        a {
            display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-control); font-size: 12.5px; color: var(--nav-ink);
            &:hover { background: var(--nav-blue-soft); color: var(--nav-blue-deep); }
            i { width: 16px; text-align: center; color: var(--nav-muted); }
            &:hover i { color: var(--nav-blue); }
        }
        .mm-group-title {
            padding: 8px 10px 4px; font-size: 9px; text-transform: uppercase; letter-spacing: .05em; color: var(--nav-muted); font-weight: normal; border-bottom: 1px solid var(--nav-line-soft);
            &:first-child { padding-top: 4px; }
        }
        .mm-group-note {
            padding: 4px 10px 8px; font-size: 12px; color: var(--nav-muted);
        }
        .mm-item-disabled {
            display: flex; align-items: center; gap: 10px; padding: 8px 10px;
            border-radius: var(--r-control); font-size: 12.5px; color: var(--nav-muted);
            cursor: default; opacity: .55;
            i { width: 16px; text-align: center; }
        }
    }
    .toolbar-group-anchor > .more-menu,
    .toolbar-group > .more-menu { left: 0; right: auto; transform-origin: top left; }
    .action-toolbar > .more-menu,
    .action-toolbar .toolbar-group:last-of-type .toolbar-group-anchor > .more-menu,
    .action-toolbar .toolbar-group:last-of-type > .more-menu { right: 0; left: auto; transform-origin: top right; }
}

/* Метки складов (TODO-084) */
.wh-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.wh-chips .wh-chip { margin-right: 0; }
.wh-chip {
    display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px;
    border-radius: var(--r-pill, 999px); border: 1px solid transparent;
    font-size: 11px; font-weight: 600; white-space: nowrap;
    margin-right: 6px;
    i { font-size: 11px; line-height: 1; }
}
.wh-chip--blue { background: #e8f1fb; border-color: #b7d0ee; color: #0b5cad; }
.wh-chip--green { background: #e7f6ee; border-color: #b6dfc6; color: #147a3e; }
.wh-chip--orange { background: #fff1e6; border-color: #f0c49a; color: #b45a00; }
.wh-chip--red { background: #fdecea; border-color: #f0b8b4; color: #b3261e; }
.wh-chip--purple { background: #f3e8fa; border-color: #d9b8e8; color: #7a2ea0; }
.wh-chip--teal { background: #e6f7f5; border-color: #a9ddd6; color: #0f766e; }
.wh-chip--gray { background: #eef1f4; border-color: #cfd6de; color: #4b5563; }


/* Дропдаун в строке крошек (кабинет ROKO: кнопка «Связь») — от правого края,
   как у .action-toolbar: сама .page-breadcrumb не позиционирована, анкер даёт
   .toolbar-group-anchor. Жирность крошек пунктам меню не передаётся — меню такое же,
   как в тулбаре. */
.acc2 .page-breadcrumb .toolbar-group-anchor > .more-menu {
    right: 0;
    left: auto;
    transform-origin: top right;
    font-weight: normal;
}
