/**
 * Artcore CMS
 *
 * @copyright (c) 2026 АРТЕФАКТ. Все права защищены.
 * @license   Проприетарная лицензия, см. LICENSE.txt
 */

/* Админ-панель, оформление «Облако»: светлый серебристый фон, полупрозрачное меню, белые карточки, синий акцент. */

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("fonts/inter-cyrillic-ext.woff2") format("woff2");
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("fonts/inter-cyrillic.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("fonts/inter-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("fonts/inter-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --bg: #eef0f3;
    --fg: #1d1d1f;
    --mut: #6e6e73;
    --faint: #98989d;
    --line: #ececf0;
    --line-strong: #d6d6db;
    --card: #ffffff;
    --hover: #f6f6f9;
    --soft: #fafafc;
    --side: rgba(255, 255, 255, .7);
    --side-fg: #1d1d1f;
    --side-mut: #8e8e93;
    --side-active: #ffffff;
    --acc: #0071e3;
    --acc-hover: #0064c8;
    --acc-soft: #e6f0fc;
    --acc-ink: #0066cc;
    --ok: #1f8a43;
    --ok-soft: #e3f6e9;
    --err: #c9302c;
    --err-soft: #fdecec;
    --warn: #8a5a00;
    --warn-soft: #fff4d6;
    --r: 12px;
    --r-card: 20px;
    --side-w: 240px;
    --font: "Inter", system-ui, -apple-system, "Helvetica Neue", "Segoe UI", Arial, sans-serif;
    color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.5 var(--font); font-feature-settings: "cv11", "ss01"; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0; }
[hidden] { display: none !important; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 15px; height: 15px; }
.mut { color: var(--mut); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

/* Каркас */
.shell { min-height: 100vh; display: flex; }
.side {
    width: var(--side-w); flex: none; background: var(--side); color: var(--side-fg);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.logo { display: flex; align-items: center; padding: 24px 22px 16px; color: var(--fg); text-decoration: none; }
.brand { display: inline-flex; align-items: center; line-height: 0; }
.brand .mark { display: block; width: 112px; height: auto; }
.brand .brand-cms { fill: #8e8e93; }
.side nav { padding: 4px 10px 16px; flex: 1; }
.side-group { font-size: 12px; color: var(--side-mut); padding: 14px 10px 6px; }
.side-link {
    display: flex; align-items: center; gap: 10px; padding: 7px 10px; margin: 1px 0;
    border-radius: var(--r); color: var(--side-fg); text-decoration: none; font-size: 14px;
}
.side-link:hover { background: rgba(255, 255, 255, .85); color: var(--fg); }
.side-link[aria-current="page"] { background: var(--side-active); color: var(--acc-ink); font-weight: 600; box-shadow: 0 2px 10px rgba(0, 0, 0, .07); }
.side-link[aria-current="page"] .ic { color: var(--acc); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
    height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 24px;
    background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.top-site { display: inline-flex; align-items: center; gap: 6px; flex: 0 1000 auto; max-width: 260px; padding: 6px 8px; border-radius: var(--r); font-size: 13px; font-weight: 500; color: var(--mut); text-decoration: none; white-space: nowrap; min-width: 0; }
.top-site span { overflow: hidden; text-overflow: ellipsis; }
.top-site .ic { flex: none; }
.top-site:hover { color: var(--fg); background: var(--hover); }
/* Хлебные крошки в верхней панели. */
.top .crumbs { display: flex; align-items: center; gap: 2px; min-width: 0; flex: 0 10 auto; font-size: 14px; color: var(--mut); white-space: nowrap; overflow: hidden; }
.top .crumbs a, .crumbs .crumb-current { display: inline-flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 6px; border-radius: 6px; overflow: hidden; text-overflow: ellipsis; }
.top .crumbs a { color: var(--mut); text-decoration: none; flex: 0 0 auto; max-width: 200px; }
.top .crumbs a:hover { color: var(--fg); background: var(--hover); }
.top .crumbs .crumb-home { flex: none; }
.top .crumbs .crumb-home .ic { width: 17px; height: 17px; }
.top .crumbs .crumb-current { color: var(--fg); font-weight: 600; flex: 0 0 auto; max-width: 360px; display: block; }
.top .crumbs .crumb-current.crumb-home { display: inline-flex; }
.top .crumbs .crumb-sep { display: inline-flex; flex: none; color: var(--faint); }
.top-spacer { flex: 1; }
.burger { display: none; }

.langs { display: flex; gap: 2px; background: var(--bg); border-radius: var(--r); padding: 2px; }
.langs button {
    font: inherit; font-size: 12px; font-weight: 500; border: 0; background: transparent; color: var(--mut);
    padding: 4px 9px; border-radius: 6px; cursor: pointer;
}
.langs button[aria-pressed="true"] { background: var(--card); color: var(--fg); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

.profile { position: relative; }
.profile > summary {
    list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer;
    padding: 4px 6px 4px 4px; border-radius: var(--r);
}
.profile > summary::-webkit-details-marker { display: none; }
.profile > summary:hover { background: var(--hover); }
.avatar {
    width: 30px; height: 30px; border-radius: 50%; background: var(--acc); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600;
}
.profile-menu {
    position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--card);
    border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: 0 8px 24px rgba(0, 0, 0, .1); padding: 6px; z-index: 30;
}
.profile-menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.profile-menu .who small { display: block; color: var(--mut); }
.menu-item {
    display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border-radius: 6px;
    font: inherit; color: var(--fg); text-decoration: none; background: transparent; border: 0; cursor: pointer; text-align: left;
}
.menu-item:hover { background: var(--hover); }

.content { padding: 24px; width: 100%; }
.page-head { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.page-head h1 { font-size: 22px; }
.page-head .sub { color: var(--mut); margin-top: 4px; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Уведомления */
.notice {
    display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px 10px 14px; border-radius: var(--r);
    background: var(--ok-soft); color: var(--ok);
}
.notice.error { background: var(--err-soft); color: var(--err); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice p { flex: 1; padding-top: 1px; }
.notice button { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 2px; border-radius: 4px; }
/* Уведомления после действия: карточки справа сверху, под закреплённой шапкой */
.toasts { position: fixed; top: 80px; right: 24px; z-index: 60; width: min(360px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.bare .toasts { top: 16px; right: 16px; }
.toast {
    --c: var(--ok);
    position: relative; overflow: hidden; pointer-events: auto;
    display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px 14px 14px;
    background: var(--card); color: var(--fg); border-radius: 14px; font-size: 14px; line-height: 1.4;
    box-shadow: 0 12px 34px rgba(0,0,0,.14), 0 0 0 1px rgba(0,0,0,.04);
    animation: toast-in .28s cubic-bezier(.2,.8,.2,1);
    transition: opacity .2s, transform .2s;
}
.toast.error { --c: var(--err); }
.toast > .ic { flex: none; width: 20px; height: 20px; color: var(--c); }
.toast p { flex: 1; min-width: 0; padding-top: 1px; overflow-wrap: anywhere; }
.toast button { flex: none; border: 0; background: transparent; color: var(--mut); cursor: pointer; padding: 2px; border-radius: 6px; }
.toast button:hover { color: var(--fg); background: var(--hover); }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--c); opacity: .5; animation: toast-bar 5s linear forwards; }
.toast.is-paused .toast-bar { animation-play-state: paused; }
.toast.is-leaving { opacity: 0; transform: translateX(24px); }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } }
@keyframes toast-bar { from { width: 100%; } to { width: 0; } }
@media (max-width: 700px) { .toasts { top: 76px; right: 16px; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; transition: none; } .toast-bar { display: none; } }

/* Кнопки */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font: inherit; font-weight: 500; font-size: 14px; line-height: 1; padding: 9px 14px; min-height: 36px;
    border-radius: var(--r); border: 1px solid var(--acc); background: var(--acc); color: #fff;
    text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--acc-hover); border-color: var(--acc-hover); }
.btn.ghost { background: var(--card); color: var(--fg); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { background: var(--card); color: var(--err); border-color: #e7c4c4; }
.btn.danger:hover { background: var(--err-soft); }
.btn.sm { min-height: 30px; padding: 6px 10px; font-size: 13px; }
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
    border-radius: var(--r); border: 0; background: transparent; color: var(--mut); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--hover); color: var(--fg); }
.icon-btn.danger:hover { background: var(--err-soft); color: var(--err); }

/* Карточки */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); }
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 15px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { padding: 18px 20px; }
.stat .label { color: var(--mut); font-size: 13px; }
.stat .value { font-size: 28px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 14px; color: var(--mut); font-weight: 500; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }

/* Списки */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.search { position: relative; flex: 1 1 240px; max-width: 360px; }
.search .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
.list th {
    text-align: left; font-weight: 500; font-size: 12px; color: var(--mut); padding: 10px 12px; white-space: nowrap;
    border-bottom: 1px solid var(--line); background: var(--soft);
}
.list td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.list tbody tr:last-child td { border-bottom: 0; }
.list tbody tr:hover td { background: var(--hover); }
.list .check { width: 40px; padding-left: 16px; }
.list .row-actions { width: 1%; white-space: nowrap; text-align: right; padding-right: 12px; }
.list .row-actions form { display: inline; }
.list a.title { font-weight: 500; text-decoration: none; }
.list a.title:hover { color: var(--acc-ink); text-decoration: underline; }
.list small { display: block; color: var(--mut); }
.sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; text-decoration: none; }
.sort:hover { color: var(--fg); }
.sort.is-active { color: var(--fg); }
.list-info { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.per-page { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--mut); }
.per-page select { width: auto; padding-top: 4px; padding-bottom: 4px; }
.list-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.bulk select { width: auto; }
.empty { padding: 48px 20px; text-align: center; color: var(--mut); }
.empty strong { display: block; color: var(--fg); font-size: 15px; margin-bottom: 4px; }
.pager { display: flex; align-items: center; gap: 4px; }
.pager a, .pager span {
    min-width: 32px; height: 32px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 6px; text-decoration: none; color: var(--fg); font-variant-numeric: tabular-nums;
}
.pager a:hover { background: var(--hover); }
.pager [aria-current="page"] { background: var(--fg); color: #fff; }
.pager .gap { color: var(--faint); }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 999px; background: var(--bg); color: var(--mut); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.acc { background: var(--acc-soft); color: var(--acc-ink); }

/* Формы */
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"],
input[type="url"], input[type="date"], input[type="datetime-local"], select, textarea {
    font: inherit; font-size: 14px; color: var(--fg); background: var(--card); width: 100%;
    border: 1px solid var(--line-strong); border-radius: var(--r); padding: 8px 11px; min-height: 36px;
}
select { padding-right: 30px; }
textarea { min-height: 96px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #bfbeb6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px rgba(0, 113, 227, .18); }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--acc); margin: 0; }
.search input { padding-left: 34px; } /* после общих правил полей, иначе отступ под значок перебивается */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-section { padding: 20px 22px; }
.form-section + .form-section { border-top: 1px solid var(--line); }
.form-section h2 { font-size: 15px; margin-bottom: 4px; }
.form-section > .mut { margin-bottom: 16px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px 20px; margin-top: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-weight: 500; font-size: 13px; }
.field .hint { font-size: 12px; color: var(--mut); }
.field .error { font-size: 12px; color: var(--err); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--err); }
.checkline { display: flex; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 16px 22px; border-top: 1px solid var(--line); background: var(--soft); border-radius: 0 0 var(--r-card) var(--r-card); }
.form-actions .left { margin-right: auto; }

/* Вкладки */
.tabs-list { display: flex; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs-list [role="tab"] {
    font: inherit; font-weight: 500; color: var(--mut); background: transparent; border: 0; cursor: pointer;
    padding: 13px 12px 11px; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs-list [role="tab"]:hover { color: var(--fg); }
.tabs-list [role="tab"][aria-selected="true"] { color: var(--fg); border-bottom-color: var(--acc); }
.tabs-list .tab-error { width: 6px; height: 6px; border-radius: 50%; background: var(--err); display: inline-block; margin-left: 6px; vertical-align: middle; }

/* Матрица прав */
.matrix th, .matrix td { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix .group td { background: var(--soft); font-weight: 600; font-size: 12px; color: var(--mut); padding-top: 14px; }
.matrix tbody tr.group:hover td { background: var(--soft); }
.role-head { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.role-head small { font-weight: 400; }

/* Журнал */
.log-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; flex: 1; }
.log-filters input, .log-filters select { min-height: 34px; }

/* Формы контента: языковые вкладки и боковая колонка */
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
.side-cards { display: flex; flex-direction: column; gap: 16px; }
.side-cards h2 { font-size: 14px; margin-bottom: 10px; }
.fields.one { grid-template-columns: minmax(0, 1fr); margin-top: 0; }
.lang-tabs [role="tab"] { display: inline-flex; align-items: center; gap: 7px; }
.lang-tabs .badge { font-size: 11px; padding: 1px 7px; }
.lang-state { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.lang-state.is-filled { background: #2f9e44; }
.lang-chip {
    display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-right: 3px;
    border-radius: 5px; font-size: 11px; font-weight: 600; background: transparent; color: var(--faint);
    box-shadow: inset 0 0 0 1px var(--line-strong);
}
.lang-chip.is-filled { background: var(--fg); color: #fff; box-shadow: none; }
/* Меню «⋯» у выбранной языковой вкладки материала */
.lang-tabs .lang-more { display: none; align-self: center; width: 26px; height: 26px; margin-left: -4px; margin-right: 6px; padding: 0; border: 0; border-radius: 6px; background: var(--bg); color: var(--mut); cursor: pointer; align-items: center; justify-content: center; flex: none; }
.lang-tabs [aria-selected="true"] + .lang-more { display: inline-flex; }
.lang-tabs .lang-more:hover, .lang-tabs .lang-more[aria-expanded="true"] { background: var(--line); color: var(--fg); }
.lang-tabs .lang-more .ic { width: 16px; height: 16px; }
.lang-menu { position: absolute; z-index: 60; width: 270px; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .14); font-size: 13px; }
.lang-menu-head { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; color: var(--mut); }
.lang-menu-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px; background: none; font: inherit; color: var(--fg); text-align: left; cursor: pointer; }
.lang-menu-item:hover:not(:disabled), .lang-menu-item:focus-visible { background: var(--hover); outline: none; }
.lang-menu-item:disabled { color: var(--mut); opacity: .6; cursor: default; }
.lang-menu-item .ic { width: 16px; height: 16px; color: var(--mut); flex: none; }
.lang-menu-item svg:not(.ic) { width: 18px; height: 12px; flex: none; border-radius: 2px; }
.lang-menu-item span { flex: 1; }
.lang-menu-item small { color: var(--mut); font-size: 11px; }
.lang-menu-item.is-danger, .lang-menu-item.is-danger .ic { color: var(--err); }
.lang-menu-sep { height: 1px; background: var(--line); margin: 4px 0; }
.lang-menu-ask { padding: 10px 10px 8px; line-height: 1.45; }
.lang-menu-row { display: flex; gap: 6px; padding: 0 10px 10px; }
.lang-done { margin-bottom: 14px; }
.title-input { font-size: 17px; font-weight: 500; }
details.seo { border-top: 1px solid var(--line); padding-top: 12px; }
details.seo summary { cursor: pointer; font-weight: 500; font-size: 13px; color: var(--mut); margin-bottom: 12px; }
.editor .ql-toolbar.ql-snow { border-color: var(--line-strong); border-radius: var(--r) var(--r) 0 0; font-family: var(--font); background: var(--soft); }
.editor .ql-container.ql-snow { height: auto; border-color: var(--line-strong); border-radius: 0 0 var(--r) var(--r); font: 15px/1.6 var(--font); min-height: 280px; }
/* Панель редактора остаётся видна при прокрутке длинного текста. */
/* Панель редактора закрепляется под шапкой с тем же отступом, что над шапкой (12 px): шапка 12 + 56 px, отступ 12 px.
   Полоса над панелью закрывает текст, уходящий под неё при прокрутке. */
.editor .ql-toolbar.ql-snow { position: sticky; top: 80px; z-index: 6; }
.editor .ql-toolbar.ql-snow::before { content: ""; position: absolute; left: -1px; right: -1px; bottom: 100%; height: 12px; background: var(--card); pointer-events: none; }
.editor .ql-editor { min-height: 280px; }
.editor .ql-editor img { max-width: 100%; height: auto; }
.editor .ql-snow .ql-file svg { width: 18px; height: 18px; }
/* Подписи списка стилей на языке интерфейса длиннее английских («Обычный текст»). */
.ql-toolbar.ql-snow .ql-picker.ql-header { width: 150px; }
.editor textarea { font-family: var(--font); min-height: 280px; }
.image-field img { display: block; width: 100%; height: auto; border-radius: var(--r); border: 1px solid var(--line); margin-bottom: 10px; }
.image-field .hint { font-size: 13px; color: var(--mut); margin-bottom: 10px; }
.row-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.info-card dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0 0 12px; font-size: 13px; }
.info-card dt { color: var(--mut); }
.info-card dd { margin: 0; overflow-wrap: anywhere; }
.site-links { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.site-links a { display: inline-flex; align-items: center; gap: 4px; color: var(--acc-ink); }

.builder-box { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border: 1px dashed var(--line-strong); border-radius: var(--r-card); background: var(--soft); }
.builder-box > .ic { width: 28px; height: 28px; color: var(--acc); }
.builder-box p { margin: 4px 0 12px; }

/* Меню и блоки */
.menu-tree-wrap { padding: 12px 16px 16px; }
.menu-tree-wrap > .hint { color: var(--mut); font-size: 13px; margin-bottom: 10px; }
.menu-tree { list-style: none; margin: 0; padding: 0; min-height: 6px; }
.menu-tree .menu-tree { padding-left: 28px; }
.menu-node { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.menu-node.is-off { opacity: .6; }
.menu-node-text { flex: 1; min-width: 0; }
.menu-node-text small { display: block; color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-node .title { font-weight: 500; text-decoration: none; }
.menu-drag { cursor: grab; color: var(--mut); display: inline-flex; }
.menu-node .row-actions form { display: inline; }
.sortable-ghost > .menu-node { border-style: dashed; background: var(--acc-soft); }
.is-dragging li > .menu-tree:empty { min-height: 26px; margin: -2px 0 8px 28px; border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--soft); }
.is-dragging li.sortable-chosen > .menu-tree:empty { display: none; }
[data-menu-status].is-error, [data-status].is-error { color: var(--err); }
.position-head { display: flex; align-items: baseline; gap: 10px; }
.position-head code { color: var(--mut); font-size: 12px; }
.template-card { display: flex; flex-direction: column; gap: 10px; }
.template-card.is-active { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc); }
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.template-card .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.template-card form { display: inline; }

/* Медиаменеджер */
.crumbs a { color: inherit; }
.dropzone {
    display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; margin-bottom: 16px;
    padding: 24px 16px; border: 2px dashed var(--line-strong); border-radius: var(--r-card); background: var(--card);
}
.dropzone .ic { width: 28px; height: 28px; color: var(--faint); }
.dropzone.is-over { border-color: var(--acc); background: var(--acc-soft); }
.dropzone.is-busy { opacity: .6; pointer-events: none; }
.dropzone label.btn { margin-top: 6px; position: relative; }
.upload-status .error { color: var(--err); font-size: 13px; margin: 2px 0; }
.media-grid { list-style: none; margin: 0; padding: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.media-item { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.media-thumb {
    aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; width: 100%; padding: 0;
    border: 1px solid var(--line); border-radius: var(--r); background: var(--soft); cursor: pointer; overflow: hidden; color: var(--mut); text-decoration: none;
}
.media-thumb:hover { border-color: var(--acc); }
.media-thumb[data-state="copied"] { border-color: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-thumb .ext { font-weight: 600; font-size: 13px; letter-spacing: .04em; }
.media-item.is-folder .media-thumb .ic { width: 40px; height: 40px; color: var(--acc); }
.media-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; text-decoration: none; }
.media-meta { font-size: 12px; }
.media-actions { position: absolute; top: 6px; right: 6px; }
.media-actions > summary { list-style: none; background: rgba(255, 255, 255, .92); width: 28px; height: 28px; }
.media-actions > summary::-webkit-details-marker { display: none; }
.media-menu {
    position: absolute; right: 0; top: 32px; z-index: 5; width: 240px; display: flex; flex-direction: column; gap: 8px; padding: 10px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}
.media-menu form { display: flex; gap: 6px; }
.media-menu a { font-size: 13px; color: var(--acc-ink); }
body.bare .content { max-width: none; }
dialog.picker { border: 0; border-radius: 12px; padding: 0; width: min(1100px, calc(100vw - 32px)); height: min(760px, calc(100vh - 32px)); box-shadow: 0 24px 64px rgba(0, 0, 0, .25); }
dialog.picker[open] { display: flex; flex-direction: column; }
dialog.picker::backdrop { background: rgba(20, 20, 18, .45); }
.picker-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 20px; border-bottom: 1px solid var(--line); }
dialog.picker iframe { flex: 1; width: 100%; border: 0; background: var(--bg); }

/* Сравнение версий */
.diff { font-size: 14px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.diff-field { font-size: 13px; color: var(--mut); margin-bottom: 8px; }
.diff-line { padding: 3px 10px 3px 30px; position: relative; white-space: pre-wrap; word-break: break-word; }
.diff-line .sign { position: absolute; left: 10px; color: var(--faint); }
.diff-line.is-add { background: #e6f6ea; }
.diff-line.is-add .sign { color: var(--ok); }
.diff-line.is-del { background: #fcebeb; color: #7a2b2b; text-decoration: line-through; text-decoration-color: rgba(163, 45, 45, .4); }
.diff-line.is-del .sign { color: var(--err); }
.diff-del { color: var(--err); }
.diff-add { color: var(--ok); text-decoration: none; }

@media (max-width: 1180px) {
    .editor-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Окно подтверждения */
dialog.confirm { border: 0; border-radius: 12px; padding: 0; width: min(420px, calc(100vw - 32px)); box-shadow: 0 24px 64px rgba(0, 0, 0, .25); }
dialog.confirm::backdrop { background: rgba(20, 20, 18, .45); }
dialog.confirm .body { padding: 22px 22px 8px; display: flex; gap: 14px; }
dialog.confirm .body .ic { color: var(--err); width: 22px; height: 22px; margin-top: 1px; }
dialog.confirm h2 { font-size: 16px; margin-bottom: 6px; }
dialog.confirm .foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px 20px; }

/* Вход */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-brand { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.auth-brand .logo { padding: 0; color: var(--fg); }
.auth-brand .langs a {
    font-size: 12px; font-weight: 500; color: var(--mut); text-decoration: none; padding: 4px 9px; border-radius: 6px;
}
.auth-brand .langs a[aria-current="true"] { background: var(--card); color: var(--fg); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.auth-card .card { padding: 26px 26px 24px; }
.auth-card h1 { font-size: 20px; margin-bottom: 4px; }
.auth-card .site { color: var(--mut); margin-bottom: 20px; }
.auth-card .form { gap: 14px; }
.auth-card .btn { width: 100%; min-height: 40px; }
.auth-links { margin-top: 16px; text-align: center; font-size: 13px; }
.auth-links a { color: var(--mut); }
.auth-links a:hover { color: var(--fg); }

/* Планшет и телефон */
@media (max-width: 1023px) {
    .side { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; }
    body.side-open .side { transform: none; box-shadow: 0 0 48px rgba(0, 0, 0, .18); }
    body.side-open::after { content: ""; position: fixed; inset: 0; background: rgba(20, 20, 18, .4); z-index: 40; }
    .burger { display: inline-flex; margin-left: -8px; }
    .top { padding: 0 16px; }
    .content { padding: 20px 16px; }
    .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .top-site { padding: 6px; }
    .top-site span, .top .crumbs .crumb-home span { display: none; }
    .top .crumbs .crumb-mid { display: none; }
    .top .crumbs .crumb-current { flex-shrink: 1; min-width: 0; }
    .profile .profile-name { display: none; }
    .list .hide-sm { display: none; }
    .form-section { padding: 18px 16px; }
    .form-actions { padding: 14px 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .side { transition: none; }
}

/* Формы и обращения */
.form-field-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; }
.form-field-head > strong { padding-top: 32px; min-width: 24px; }
.form-field-head .row-actions { padding-top: 26px; white-space: nowrap; }
.form-field-head .row-actions form { display: inline; }
.form-field-lang { border: 0; border-top: 1px solid var(--line); margin: 14px 0 0; padding: 12px 0 0; }
.form-field-lang legend { font-size: 13px; font-weight: 600; color: var(--mut); padding-right: 8px; }
.list tr.is-unread td { font-weight: 600; }
dl.submission { display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 1fr); gap: 10px 20px; margin: 0; }
dl.submission dt { color: var(--mut); }
dl.submission dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) { dl.submission { grid-template-columns: minmax(0, 1fr); } dl.submission dd { margin-bottom: 8px; } }

/* Резервные копии */
.backup-progress { margin-bottom: 16px; }
.backup-progress progress { width: 100%; height: 10px; accent-color: var(--acc); }
.backup-progress.is-error { border-color: var(--err); color: var(--err); }
.backup-dialog { max-width: 520px; }
.backup-dialog h2 { font-size: 17px; margin-bottom: 10px; }

/* Переключатель из нескольких кнопок (состояние материала) */
.segmented { display: flex; gap: 3px; padding: 3px; background: var(--bg); border-radius: var(--r); }
.segmented label { flex: 1; min-width: 0; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented span { display: block; text-align: center; padding: 6px 4px; border-radius: 6px; font-size: 13px; color: var(--mut); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.segmented input:checked + span { background: var(--card); color: var(--fg); font-weight: 500; box-shadow: 0 0 0 1px var(--line-strong); }
.segmented input:focus-visible + span { outline: 2px solid var(--acc); outline-offset: 1px; }
.segmented input:disabled + span { cursor: not-allowed; }
/* Состояние материала: «Опубликован» — зелёная кнопка, «Снят» — красная (как переключатель в списке). */
.segmented.is-status .is-published input:checked + span { background: var(--ok); color: #fff; box-shadow: none; }
.segmented.is-status .is-unpublished input:checked + span { background: var(--err); color: #fff; box-shadow: none; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--acc-ink); font: inherit; font-weight: 500; cursor: pointer; justify-self: start; }
.link-btn:hover { text-decoration: underline; }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }

/* Флаги языков: вкладки и столбец «Языки» в списках */
.flag { display: inline-block; width: 20px; height: 14px; border-radius: 2px; flex: none; vertical-align: middle; }
.flag-code { width: auto; height: auto; font-size: 10px; font-weight: 600; padding: 1px 4px; background: var(--bg); color: var(--mut); }
.flag-chip { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 18px; margin-right: 3px; border-radius: 4px; vertical-align: middle; }
.flag-chip.is-empty { opacity: 0; }

/* Выбор столбцов таблицы */
.columns-menu { position: relative; margin-left: auto; }
.columns-menu summary { list-style: none; }
.columns-menu summary::-webkit-details-marker { display: none; }
.columns-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 220px; display: grid; gap: 8px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 8px 24px rgba(0, 0, 0, .1); }

/* Аварийное восстановление пароля */
.recovery-steps { margin: 12px 0; padding-left: 20px; display: grid; gap: 8px; }
.recovery-code { display: inline-block; margin-top: 4px; padding: 6px 10px; border-radius: var(--r); background: var(--bg); font-size: 16px; letter-spacing: 1px; user-select: all; }

/* Раздел «SEO» */
.seo-list td { vertical-align: top; }
.seo-list .seo-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 520px; }
.seo-len { display: block; margin-top: 2px; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.seo-len.is-over, [data-seo-count].is-over { color: var(--err); font-weight: 500; }
.seo-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.seo-preview { padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); font-family: Arial, sans-serif; }
.seo-preview p { margin: 0; }
.seo-preview-label { font-family: var(--font); font-size: 12px; color: var(--mut); margin-bottom: 10px !important; }
.seo-preview-url { font-size: 13px; color: #4d5156; word-break: break-all; }
.seo-preview-title { font-size: 19px; line-height: 1.3; color: #1a0dab; margin: 4px 0 !important; }
.seo-preview-text { font-size: 14px; line-height: 1.5; color: #4d5156; }
@media (max-width: 900px) { .seo-grid { grid-template-columns: minmax(0, 1fr); } }

/* Галерея в визуальном редакторе */
.ql-editor .ac-gallery-embed { --ac-g: 3; margin: 1.5em 0; gap: 8px; }
.ql-editor .ac-gallery-embed.ac-gcols-2 { --ac-g: 2; } .ql-editor .ac-gallery-embed.ac-gcols-3 { --ac-g: 3; } .ql-editor .ac-gallery-embed.ac-gcols-4 { --ac-g: 4; }
.ql-editor .ac-gallery-embed.ac-gcols-5 { --ac-g: 5; } .ql-editor .ac-gallery-embed.ac-gcols-6 { --ac-g: 6; }
.ql-editor .ac-gallery-embed .ac-gitem { margin: 0; }
.ql-editor .ac-gallery-embed a { display: block; }
.ql-editor .ac-gallery-embed img { display: block; width: 100%; height: auto; margin: 0; border-radius: 6px; }
.ql-editor .ac-gview-grid { display: grid; grid-template-columns: repeat(var(--ac-g), minmax(0, 1fr)); }
.ql-editor .ac-gview-grid img { aspect-ratio: 1; object-fit: cover; }
.ql-editor .ac-gview-masonry { column-count: var(--ac-g); column-gap: 8px; }
.ql-editor .ac-gview-masonry .ac-gitem { break-inside: avoid; margin-bottom: 8px; }
/* Слайдшоу в редакторе: первое изображение крупно (первый слайд), остальные — миниатюрами. */
.ql-editor .ac-gview-slideshow { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.ql-editor .ac-gview-slideshow .ac-gitem:first-child { grid-column: 1 / -1; }
.ql-editor .ac-gview-slideshow img { aspect-ratio: 1; object-fit: cover; }
.ql-editor .ac-gview-slideshow .ac-gitem:first-child img { aspect-ratio: 16 / 9; }
.ql-editor .ac-gview-strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.ql-editor .ac-gview-strip .ac-gitem { flex: 0 0 calc((100% - (var(--ac-g) - 1) * 8px) / var(--ac-g)); scroll-snap-align: start; }
.ql-editor .ac-gview-strip img { aspect-ratio: 4 / 3; object-fit: cover; }
@media (max-width: 640px) {
    .ql-editor .ac-gview-grid, .ql-editor .ac-gview-masonry { --ac-g: 2 !important; }
    .ql-editor .ac-gview-strip .ac-gitem { flex-basis: 80%; }
}
.ql-editor .ac-gallery-embed { cursor: pointer; outline: 2px dashed transparent; outline-offset: 4px; border-radius: 6px; }
.ql-editor .ac-gallery-embed:hover { outline-color: var(--acc); }
.ql-editor .ac-gallery-embed img { max-width: 100%; }
dialog.gallery-dialog { width: min(760px, calc(100vw - 32px)); border: 0; border-radius: 12px; padding: 0; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
dialog.gallery-dialog::backdrop { background: rgba(0, 0, 0, .45); }
.gallery-dialog-body { padding: 20px; display: grid; gap: 16px; max-height: calc(100vh - 64px); overflow: auto; }
.gallery-dialog-body h2 { font-size: 18px; margin: 0; }
.gallery-drop { border: 2px dashed var(--line-strong); border-radius: var(--r); padding: 16px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.gallery-drop.is-over { border-color: var(--acc); background: var(--acc-soft); }
.gallery-drop p { margin: 0; color: var(--mut); }
.gallery-items { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.gallery-items li { position: relative; display: grid; gap: 6px; cursor: grab; }
.gallery-items li.is-ghost { opacity: .4; }
.gallery-item-remove { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.gallery-item-remove:hover { background: #d70015; }
.gallery-items img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--bg); }
.gallery-items input { min-height: 30px; padding: 4px 8px; font-size: 13px; }
.gallery-options { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.gallery-dialog-foot { justify-content: flex-end; }

/* Поле «дата и время» со своим календарём */
.dt-field { position: relative; }
.dt-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 8px; }
.dt-input { position: relative; }
.dt-input input { padding-right: 38px; font-variant-numeric: tabular-nums; }
.dt-input .icon-btn { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; }
.dt-field.has-error .dt-input input { border-color: var(--err); }
.dt-pop { position: absolute; z-index: 30; top: 100%; left: 0; margin-top: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 10px 28px rgba(0, 0, 0, .12); padding: 10px; }
.dt-cal { width: 280px; }
.dt-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dt-cal-head strong { font-size: 14px; text-transform: capitalize; }
.dt-nav { width: 30px; height: 30px; border: 0; border-radius: 6px; background: none; font-size: 18px; cursor: pointer; color: var(--fg); }
.dt-nav:hover { background: var(--bg); }
.dt-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dt-wd { text-align: center; font-size: 11px; color: var(--faint); padding: 4px 0; text-transform: capitalize; }
.dt-day { height: 32px; border: 0; border-radius: 6px; background: none; font: inherit; font-size: 13px; cursor: pointer; color: var(--fg); font-variant-numeric: tabular-nums; }
.dt-day:hover { background: var(--bg); }
.dt-day.is-today { box-shadow: inset 0 0 0 1px var(--acc); }
.dt-day.is-picked { background: var(--acc); color: #fff; font-weight: 600; }
.dt-cal-foot { margin-top: 8px; text-align: right; }
.dt-times { right: 0; left: auto; width: 230px; max-height: 220px; overflow: auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.dt-time { height: 30px; border: 1px solid var(--line); border-radius: 6px; background: none; font: inherit; font-size: 12px; cursor: pointer; font-variant-numeric: tabular-nums; }
.dt-time:hover { border-color: var(--acc); }
.dt-time.is-picked { background: var(--acc); color: #fff; border-color: var(--acc); }
.switch-line { display: flex; align-items: center; gap: 10px; font-weight: 400; cursor: pointer; }
.switch { appearance: none; width: 34px !important; height: 20px !important; border-radius: 99px; background: var(--line-strong); position: relative; cursor: pointer; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch:checked { background: var(--acc); }
.switch:checked::after { left: 16px; }
.switch:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

/* Медиатека: вид, отметки, поворот */
.view-switch { display: inline-flex; margin-left: auto; background: var(--bg); border-radius: var(--r); padding: 2px; gap: 2px; }
.view-switch a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 6px; color: var(--mut); text-decoration: none; font-size: 13px; }
.view-switch a.is-on { background: var(--card); color: var(--fg); box-shadow: 0 0 0 1px var(--line-strong); }
.media-bulk [data-media-delete].is-off { visibility: hidden; }
.media-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.media-check { position: absolute; z-index: 3; top: 8px; left: 8px; width: 18px !important; height: 18px !important; }
.media-rotate { position: absolute; z-index: 3; top: 6px; right: 40px; }
.media-rotate .icon-btn { width: 28px; height: 28px; background: rgba(255, 255, 255, .92); }
.media-item .media-date { display: none; }
.media-grid.is-list { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0; }
.media-grid.is-list .media-item { flex-direction: row; align-items: center; gap: 14px; padding: 8px 16px 8px 44px; border-bottom: 1px solid var(--line); min-height: 60px; }
.media-grid.is-list .media-check { top: 50%; left: 16px; transform: translateY(-50%); }
.media-grid.is-list .media-thumb { width: 52px; height: 52px; flex: none; aspect-ratio: auto; }
.media-grid.is-list .media-name { flex: 1; font-size: 14px; }
.media-grid.is-list .media-meta { width: 170px; flex: none; }
.media-grid.is-list .media-date { display: block; width: 130px; flex: none; font-size: 12px; }
.media-grid.is-list .media-rotate, .media-grid.is-list .media-actions { position: static; }
.media-grid.is-list .media-item.is-folder .media-thumb .ic { width: 26px; height: 26px; }
.image-field { position: relative; }
.image-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; }
.image-tools .icon-btn { width: 30px; height: 30px; background: rgba(255, 255, 255, .92); }
.image-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 120px; margin-bottom: 12px; padding: 16px; border: 2px dashed var(--line-strong); border-radius: var(--r); background: var(--hover); color: var(--mut); font-size: 13px; text-align: center; cursor: pointer; }
.image-drop .ic { width: 28px; height: 28px; color: var(--faint); }
.site-icon-field img { width: 96px; height: 96px; object-fit: cover; }
.mode-badge { display: inline-flex; vertical-align: -2px; margin-left: 6px; color: var(--acc); }
.image-drop:hover, .image-drop.is-over { border-color: var(--acc); color: var(--acc-ink); background: var(--acc-soft); }
.image-drop:focus-within { outline: 2px solid var(--acc); outline-offset: 2px; }
.image-field.is-over:not(.is-empty) { outline: 2px dashed var(--acc); outline-offset: 4px; border-radius: var(--r); background: var(--acc-soft); }

/* Кнопка «Действия» над списком и меню действий с отмеченными строками. */
.bulk-menu { position: relative; }
.bulk-menu > .btn:disabled { opacity: .5; cursor: not-allowed; }
.bulk-count { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--acc); color: #fff; font-size: 12px; line-height: 18px; text-align: center; }
.bulk-count.is-empty { visibility: hidden; }
.bulk-pop { position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; min-width: 300px; display: grid; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 8px 24px rgba(0, 0, 0, .1); }
.bulk-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: none; color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
.bulk-item:hover, .bulk-item:focus-visible { background: var(--hover); }
.bulk-item.is-danger { color: var(--err); }
.bulk-item.is-danger:hover, .bulk-item.is-danger:focus-visible { background: var(--err-soft); }

/* Состояние материала в списке: значок, нажатие публикует или снимает с публикации. */
.state-col { width: 1%; text-align: center; }
.state-toggle { display: inline; margin: 0; }
.state-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--mut); }
button.state-icon { cursor: pointer; }
.state-icon svg { width: 16px; height: 16px; }
.state-icon.is-published { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.state-icon.is-unpublished { background: var(--err-soft); border-color: transparent; color: var(--err); }
.state-icon.is-scheduled { background: var(--acc-soft); border-color: transparent; color: var(--acc-ink); }
button.state-icon:hover { box-shadow: 0 0 0 2px var(--line-strong); }

/* Документы: дерево разделов слева, список справа. */
/* Документы в три колонки: дерево разделов, файлы, настройки раздела. */
.docs-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
/* Открытая панель справа забирает ширину у дерева разделов. */
.docs-layout.has-panel { grid-template-columns: 240px minmax(0, 1fr) 320px; }
@media (min-width: 1700px) {
    .docs-layout.has-panel { grid-template-columns: 280px minmax(0, 1fr) 340px; }
}
.docs-tree-toggle { display: none; }
.docs-layout .toolbar { min-height: 62px; }
.docs-layout .search { flex-basis: 120px; }
.docs-layout .toolbar #f-type { max-width: 145px; }
.docs-table th.docs-col-title { width: 50%; }
.docs-filebar .docs-gear, .docs-bar-end { margin-left: auto; }
.docs-bar-end { display: flex; gap: 8px; }
.docs-view { display: flex; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; }
.docs-view a { display: inline-flex; align-items: center; justify-content: center; width: 38px; min-height: 36px; color: var(--mut); }
.docs-view a + a { border-left: 1px solid var(--line-strong); }
.docs-view a:hover { background: var(--hover); color: var(--fg); }
.docs-view a[aria-current] { background: var(--acc-soft); color: var(--acc-ink); }
.docs-view a:focus-visible { outline: 2px solid var(--acc); outline-offset: -2px; }
@media (max-width: 1500px) {
    .docs-table.is-all .num:nth-last-child(2) { display: none; }
}
@media (min-width: 1361px) and (max-width: 1700px) {
    /* При открытой панели размер, дата и скачивания видны в ней — таблице хватает ширины. */
    .docs-layout.has-panel .docs-table .num { display: none; }
}
.docs-gear[aria-expanded="true"] { border-color: var(--acc); color: var(--acc-ink); background: var(--acc-soft); }
.docs-layout .toolbar[hidden], .docs-clip[hidden], .docs-panel[hidden], .docs-toast[hidden] { display: none; }
.docs-panel-tabs { display: flex; gap: 4px; margin: -4px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.docs-panel-tabs [data-docs-tab] { padding: 6px 10px; border: 0; border-radius: 6px; background: none; color: var(--mut); font: inherit; font-size: 13px; cursor: pointer; }
.docs-panel-tabs [data-docs-tab][aria-pressed="true"] { background: var(--acc-soft); color: var(--acc-ink); font-weight: 500; }
.docs-panel-tabs [data-docs-tab][hidden] { display: none; }
.docs-panel-tabs .icon-btn { margin-left: auto; }
.docs-new { width: 100%; margin-bottom: 8px; }
.docs-tree-list { list-style: none; margin: 0; padding: 0; }
.docs-tree-list .docs-tree-list { padding-left: 16px; }
.docs-node.is-collapsed > .docs-tree-list { display: none; }
.docs-tree .docs-node > .docs-tree-item { padding: 4px 6px 4px 2px; gap: 4px; }
.docs-caret { width: 18px; height: 22px; flex: none; border: 0; background: none; padding: 0; cursor: pointer; color: var(--mut); position: relative; border-radius: 4px; }
.docs-caret::before { content: ""; position: absolute; left: 6px; top: 7px; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.docs-caret[aria-expanded="false"]::before { transform: rotate(-45deg); left: 4px; top: 8px; }
.docs-caret[hidden] { display: inline-block; visibility: hidden; }
.docs-tree-item .docs-handle, .docs-tree-item .docs-node-actions { flex: none; }
.docs-handle { display: inline-flex; color: #c98a2a; flex: none; }
.docs-tree-item .docs-handle svg { color: #c98a2a; }
.docs-handle .ic { width: 18px; height: 18px; }
.docs-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; text-decoration: none; font-size: 14px; }
.docs-node > .docs-tree-item.is-hidden .docs-name { color: var(--mut); text-decoration: line-through; }
.docs-node-actions { display: none; gap: 0; flex: none; margin-block: -6px; }
.docs-node > .docs-tree-item:hover .docs-node-actions, .docs-node > .docs-tree-item:focus-within .docs-node-actions { display: inline-flex; }
.docs-node > .docs-tree-item:hover small, .docs-node > .docs-tree-item:focus-within small { display: none; }
.docs-node-actions .icon-btn { width: 24px; height: 24px; }
.docs-node-actions .icon-btn .ic { width: 15px; height: 15px; }
.docs-rename { flex: 1; min-width: 0; height: 26px; padding: 2px 6px; font: inherit; font-size: 14px; border: 1px solid var(--acc); border-radius: 5px; }
.docs-rename.is-error { border-color: var(--err); background: var(--err-soft); }
.docs-node.is-ghost > .docs-tree-item { background: var(--acc-soft); outline: 1px dashed var(--acc); }
.docs-tree-hint { margin: 8px 6px 2px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12px; color: var(--mut); }
.docs-tree-hint.is-ok { color: var(--ok); }
.docs-tree-hint.is-error { color: var(--err); }
.docs-pop { width: 320px; padding: 4px; }
.docs-pop-actions { display: flex; flex-direction: column; gap: 6px; padding: 0 10px 10px; }
.docs-pop-actions .btn { justify-content: flex-start; white-space: normal; text-align: left; }
/* Правая колонка — настройки раздела. */
.docs-panel { padding: 14px; position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; }
.docs-panel-empty { display: flex; gap: 8px; color: var(--mut); font-size: 13px; margin: 0; }
.docs-panel-form { display: flex; flex-direction: column; gap: 14px; }
.docs-panel-head { display: flex; gap: 10px; align-items: center; }
.docs-panel-head strong { display: block; font-size: 15px; }
.docs-panel-head small { color: var(--mut); font-size: 12px; }
.docs-panel-ic { width: 34px; height: 34px; border-radius: 8px; background: #fdf3e2; color: #c98a2a; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.docs-panel-switch { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.docs-displays { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.docs-displays legend { font-size: 12px; font-weight: 600; color: var(--mut); margin-bottom: 6px; padding: 0; }
.docs-display { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 12px; text-align: center; }
.docs-display input { position: absolute; opacity: 0; pointer-events: none; }
.docs-display:has(input:checked) { border-color: var(--acc); background: var(--acc-soft); color: var(--acc-ink); font-weight: 500; }
.docs-display:has(input:focus-visible) { outline: 2px solid var(--acc); outline-offset: 2px; }
.docs-display-pic { width: 64px; height: 40px; display: grid; gap: 3px; padding: 4px; border-radius: 4px; background: var(--bg); }
.docs-display-pic i { display: block; background: var(--line-strong); border-radius: 2px; }
.docs-display-pic.is-list { grid-template-rows: repeat(4, 1fr); }
.docs-display-pic.is-table { grid-template-rows: repeat(4, 1fr); }
.docs-display-pic.is-table i { background: linear-gradient(90deg, var(--line-strong) 55%, transparent 55% 62%, var(--line-strong) 62%); }
.docs-display-pic.is-tiles { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.docs-display-pic.is-accordion { grid-template-rows: 1.4fr .6fr 1.4fr .6fr; }
.docs-display-pic.is-accordion i:nth-child(even) { background: transparent; border: 1px dashed var(--line-strong); }
.docs-panel-status { min-height: 16px; margin: 0; font-size: 12px; color: var(--ok); }
/* Действия с файлами: вырезать, копировать, вставить, удалить; перенос на раздел; свойства файла справа. */
.docs-filebar { background: var(--acc-soft); }
.docs-filebar-info { min-width: 88px; font-size: 14px; font-weight: 500; }
.docs-clip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--bg); font-size: 13px; }
.docs-clip > .ic { width: 16px; height: 16px; color: var(--mut); }
.docs-toast { position: fixed; left: 50%; bottom: 24px; z-index: 80; transform: translateX(-50%); max-width: min(520px, calc(100vw - 32px)); padding: 10px 16px; border-radius: var(--r); background: var(--fg); color: #fff; font-size: 13px; overflow-wrap: anywhere; }
.docs-uploads { position: fixed; right: 20px; bottom: 20px; z-index: 70; width: min(360px, calc(100vw - 32px)); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
.docs-uploads-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 46px; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.docs-uploads-head .icon-btn[hidden], .docs-uploads progress[hidden] { display: none; }
.docs-uploads-list { list-style: none; margin: 0; padding: 4px 14px 10px; max-height: 260px; overflow-y: auto; }
.docs-uploads-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 6px 0; font-size: 13px; }
.docs-uploads-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docs-uploads-state { color: var(--mut); font-size: 12px; }
.docs-uploads-list .is-ready .docs-uploads-state { color: var(--ok); }
.docs-uploads-list .is-error .docs-uploads-state { grid-column: 1 / -1; color: var(--err); }
.docs-uploads progress { grid-column: 1 / -1; width: 100%; height: 6px; accent-color: var(--acc); }
.docs-table tr.is-cut td, .docs-tile.is-cut { opacity: .45; }
.docs-table tr[data-doc] { cursor: pointer; }
.docs-table tr.is-current td { background: var(--acc-soft); }
.docs-table .doc-title[draggable="true"] { cursor: grab; }
.docs-dragging-files .docs-node > .docs-tree-item { outline: 1px dashed transparent; }
.docs-node > .docs-tree-item.is-drop { background: var(--acc-soft); outline: 2px dashed var(--acc); outline-offset: -2px; }
.docs-file-panel { display: flex; flex-direction: column; gap: 12px; }
.docs-file-panel[hidden], [data-docs-section-panel][hidden] { display: none; }
.docs-file-panel .docs-panel-head strong { font-size: 14px; overflow-wrap: anywhere; }
.docs-file-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--mut); }
.docs-file-field input { min-height: 32px; font-size: 13px; color: var(--fg); }
.docs-file-links { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.docs-file-hint { margin-top: 14px; }
.docs-own { display: flex; flex-direction: column; gap: 14px; }
.docs-own[hidden] { display: none; }
.docs-panel-group { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.docs-panel-sub { font-size: 12px; font-weight: 600; color: var(--mut); }
.docs-panel-group .checkline { font-size: 13px; }
.docs-panel-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.docs-panel-group select { min-height: 32px; padding: 4px 8px; font-size: 13px; }
.docs-inherit { font-size: 13px; font-weight: 500; }
.docs-panel-hint { margin: -6px 0 0; font-size: 12px; color: var(--mut); }
.docs-panel-hint[hidden] { display: none; }
.docs-display-pic.is-tree { grid-template-rows: repeat(4, 1fr); }
.docs-display-pic.is-tree i:nth-child(2), .docs-display-pic.is-tree i:nth-child(3) { margin-left: 10px; }
.docs-display-pic.is-tree i:nth-child(3) { margin-left: 20px; }
.docs-panel-status.is-error { color: var(--err); }
@media (max-width: 1360px) {
    .docs-layout, .docs-layout.has-panel { grid-template-columns: 240px minmax(0, 1fr); }
    /* Размер и скачивания видны в свойствах файла (в общем списке — и дата). */
    .docs-table.is-all .num { display: none; }
    .docs-table .num:nth-last-child(2), .docs-table .num:nth-last-child(4) { display: none; }
    .docs-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(340px, 100vw); max-height: none; border-radius: 0; border-width: 0 0 0 1px; box-shadow: -8px 0 24px rgba(0, 0, 0, .12); }
}
.docs-tree { display: flex; flex-direction: column; padding: 8px; position: sticky; top: 76px; }
.docs-tree-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--r); color: var(--fg); text-decoration: none; font-size: 14px; }
.docs-tree-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docs-tree-item small { color: var(--mut); font-size: 12px; }
.docs-tree-item svg { color: var(--mut); }
.docs-tree-item:hover { background: var(--hover); }
.docs-tree-item.is-active { background: var(--acc-soft); color: var(--acc-ink); font-weight: 500; }
.docs-tree-item.is-active svg { color: var(--acc-ink); }
.docs-tree-item.is-hidden span { color: var(--mut); text-decoration: line-through; }
.docs-tree-add { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 8px 10px; border-top: 1px solid var(--line); color: var(--acc-ink); font-size: 13px; text-decoration: none; }
.docs-drop { margin: 4px 16px 16px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-card); background: var(--soft); transition: background .12s, border-color .12s; }
/* Значок загрузки — только картинка, не нажимается; файлы выбирают кнопкой «Выбрать файлы» или бросают на область. */
.docs-drop-body { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 18px; text-align: center; color: var(--mut); font-size: 13px; font-weight: 400; }
.docs-drop-body strong { color: var(--fg); font-size: 14px; font-weight: 500; }
.docs-drop-ic { display: inline-flex; color: var(--faint); pointer-events: none; }
.docs-drop-ic .ic { width: 44px; height: 44px; stroke-width: 1.4; }
.docs-drop-body .btn { cursor: pointer; }
.docs-drop.is-over { border-color: var(--acc); background: var(--acc-soft); }
.docs-note { display: flex; align-items: center; gap: 8px; margin: 4px 16px 16px; color: var(--mut); font-size: 13px; }
.doc-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.docs-table .doc-title { min-width: 160px; }
.doc-title small, .doc-title strong { display: block; overflow-wrap: anywhere; }
.info-card .doc-title { margin-bottom: 12px; }
.file-badge { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 40px; border-radius: 5px; background: var(--bg); color: var(--mut); font-size: 10px; font-weight: 600; letter-spacing: .02em; }
.file-badge.is-pdf { background: #fdecec; color: #b42318; }
.file-badge.is-doc, .file-badge.is-docx, .file-badge.is-odt, .file-badge.is-rtf { background: #e8f0fd; color: #1f5fbf; }
.file-badge.is-xls, .file-badge.is-xlsx, .file-badge.is-ods, .file-badge.is-csv { background: #e6f4ea; color: #1e7b3a; }
.file-badge.is-ppt, .file-badge.is-pptx, .file-badge.is-odp { background: #fdf0e4; color: #b4560f; }
.file-badge.is-zip { background: #f1ecfb; color: #6a3fc0; }
.drag-col { width: 28px; padding-right: 0 !important; }
.docs-drag { display: inline-flex; color: var(--faint); cursor: grab; }
.docs-drag:hover { color: var(--fg); }
.bulk-extra { display: grid; gap: 6px; margin-top: 6px; padding: 10px 10px 4px; border-top: 1px solid var(--line); font-size: 13px; color: var(--mut); }
.bulk-extra-row { display: flex; gap: 6px; }
.bulk-extra + .bulk-last { margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 6px 6px; }
.bulk-extra-row select { flex: 1; min-width: 0; padding-top: 4px; padding-bottom: 4px; }
@media (max-width: 900px) {
    .docs-layout, .docs-layout.has-panel { grid-template-columns: minmax(0, 1fr); }
    .docs-tree { position: static; }
    .docs-tree-toggle { display: flex; }
    .docs-tree:not(.is-open) > :not(.docs-tree-toggle) { display: none; }
    .docs-tree.is-open > .docs-new { margin-top: 8px; }
    .docs-bar-end { margin-left: 0; }
}

/* Документы плитками: путь, карточки разделов и файлов. */
.docs-layout.is-tiles { grid-template-columns: minmax(0, 1fr); }
.docs-tiles-view { padding: 12px 16px 16px; }
.docs-path { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.docs-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; min-width: 0; font-size: 14px; }
.docs-crumbs a, .docs-crumbs span { padding: 5px 8px; border-radius: 6px; overflow-wrap: anywhere; }
.docs-crumbs a { color: var(--mut); text-decoration: none; }
.docs-crumbs a:hover { background: var(--hover); color: var(--fg); }
.docs-crumbs [aria-current] { font-weight: 500; }
.docs-crumbs .ic { color: var(--faint); }
.docs-tiles-hint { margin: 6px 8px 0; padding: 0; border: 0; }
.docs-tiles-hint:empty { display: none; }
.docs-folders, .docs-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 12px; list-style: none; margin: 12px 0 0; padding: 0; }
.docs-folder .docs-tree-item { position: relative; gap: 10px; height: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); }
.docs-folder .docs-tree-item > .docs-panel-ic { flex: none; }
.docs-folder .docs-tree-item > .docs-panel-ic svg { color: #c98a2a; }
.docs-folder .docs-folder-text { display: flex; flex-direction: column; flex: 1; min-width: 0; white-space: normal; }
.docs-folder .docs-name { flex: none; font-weight: 500; }
.docs-folder .docs-name[hidden] { display: none; }
/* Щелчок по любому месту карточки открывает раздел; кнопки — поверх. */
.docs-folder .docs-name::after { content: ""; position: absolute; inset: 0; }
.docs-folder .docs-rename { flex: none; width: 100%; }
.docs-folder > .docs-tree-item:hover small, .docs-folder > .docs-tree-item:focus-within small { display: inline; }
.docs-tree-item .docs-folder-actions { position: absolute; right: 8px; top: 8px; display: inline-flex; border-radius: 6px; background: var(--card); opacity: 0; transition: opacity .12s; }
.docs-folder:hover .docs-folder-actions, .docs-folder:focus-within .docs-folder-actions { opacity: 1; }
@media (hover: none) { .docs-tree-item .docs-folder-actions { position: relative; right: auto; top: auto; opacity: 1; } }
.docs-folder-actions .icon-btn { width: 28px; height: 28px; }
.docs-tiles-all { margin-top: 18px; font-size: 13px; color: var(--mut); }
.docs-tile { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); cursor: pointer; }
.docs-tile:hover { border-color: var(--line-strong); }
.docs-tile.is-current, .docs-tile:has(input[name="ids[]"]:checked) { border-color: var(--acc); background: var(--acc-soft); }
.docs-tile-top { display: flex; align-items: center; justify-content: space-between; }
.docs-tile .doc-title { flex: 1; align-items: flex-start; cursor: grab; }
.docs-tile .doc-title .title { color: var(--fg); font-weight: 500; text-decoration: none; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.docs-tile .doc-title .title:hover { color: var(--acc-ink); text-decoration: underline; }
.docs-tile small { color: var(--mut); font-size: 12px; }
.docs-tile .doc-title small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.docs-tile-foot { display: flex; align-items: center; gap: 2px; }
.docs-tile-foot small { flex: 1; }
[data-docs-target].is-drop { background: var(--acc-soft); outline: 2px dashed var(--acc); outline-offset: -2px; }
.docs-dragging-files .docs-folder .docs-name::after { pointer-events: none; }
.docs-tiles-view + .list-foot { margin-top: 0; }
@media (min-width: 1361px) {
    .docs-layout.is-tiles.has-panel { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 1360px) {
    .docs-layout.is-tiles.has-panel { grid-template-columns: minmax(0, 1fr); }
}

/* Окно «Документ» в визуальном редакторе и вставленный раздел документов. */
.docs-dialog-tabs { margin: 0 0 14px; }
.docs-dialog-tabs a.is-active { background: var(--card); color: var(--fg); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.docs-dialog-pane { display: grid; gap: 12px; }
.docs-dialog-pane[hidden] { display: none; }
.docs-dialog-pane input[type="search"] { width: 100%; }
.docs-choices { display: grid; gap: 4px; max-height: 340px; overflow-y: auto; }
.docs-choice { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid transparent; border-radius: var(--r); background: none; color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
.docs-choice:hover, .docs-choice:focus-visible { border-color: var(--line); background: var(--hover); }
.docs-choice-body { display: flex; flex-direction: column; min-width: 0; }
.docs-choice-body small { color: var(--mut); font-size: 12px; }
.ql-editor .ac-docs-embed { position: relative; margin: 1.2em 0; padding: 28px 14px 12px; border: 1.5px dashed var(--line-strong); border-radius: 8px; background: var(--soft); cursor: pointer; }
.ql-editor .ac-docs-embed::before { content: attr(data-label); position: absolute; top: 7px; left: 14px; color: var(--mut); font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.ql-editor .ac-docs-embed:hover { border-color: var(--acc); }
.ql-editor .ac-docs-embed p { margin: 0; font-weight: 600; }

/* Переключатель «Опубликован / Снят» в списках (включён — опубликован). */
.state-switch { display: inline-flex; align-items: center; gap: 6px; padding: 4px; border: 0; border-radius: 99px; background: none; color: var(--acc-ink); cursor: pointer; vertical-align: middle; }
.state-switch.is-static { cursor: default; }
.state-switch-track { position: relative; display: block; width: 34px; height: 20px; border-radius: 99px; background: var(--line-strong); transition: background .15s, box-shadow .15s; }
.state-switch-knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: left .15s; }
.state-switch.is-on .state-switch-track { background: var(--ok); }
.state-switch.is-on .state-switch-knob { left: 16px; }
button.state-switch:hover .state-switch-track { box-shadow: 0 0 0 3px var(--hover), 0 0 0 4px var(--line-strong); }
button.state-switch:hover .state-switch-knob { left: 6px; }
button.state-switch.is-on:hover .state-switch-knob { left: 12px; }
button.state-switch:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.state-switch-clock { display: inline-flex; }

/* Визуальный редактор: цвет и размер текста, режим «Код», вставленное видео. */
.ql-editor .ql-size-small { font-size: .8em; }
.ql-editor .ql-size-large { font-size: 1.35em; }
.ql-editor .ql-size-huge { font-size: 1.8em; }
.ql-editor .ql-color-red { color: #c92a2a; }
.ql-color-orange { color: #d9480f; }
.ql-color-green { color: #2b8a3e; }
.ql-color-blue { color: #1c64c4; }
.ql-color-purple { color: #7048e8; }
.ql-color-gray { color: #6b6b66; }

textarea.code-view { width: 100%; min-height: 360px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 0 0 var(--r) var(--r); background: #1f1f1d; color: #f1f0ea; font: 13px/1.55 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; tab-size: 2; white-space: pre-wrap; }
.ql-toolbar.is-code > .ql-formats > *:not(.ql-codeview) { opacity: .35; pointer-events: none; }
.ql-toolbar .ql-codeview.ql-active, .ql-toolbar.is-code .ql-codeview { color: var(--acc); }
.code-note { margin-top: 6px; }
.ql-editor .ac-video-embed { position: relative; margin: 1.2em 0; padding: 28px 14px 12px; border: 1.5px dashed var(--line-strong); border-radius: 8px; background: var(--soft); cursor: pointer; }
.ql-editor .ac-video-embed::before { content: attr(data-label); position: absolute; top: 7px; left: 14px; color: var(--mut); font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.ql-editor .ac-video-embed:hover { border-color: var(--acc); }
.ql-editor .ac-video-embed p { margin: 0; overflow-wrap: anywhere; }
dialog.video-dialog { width: min(560px, calc(100vw - 32px)); }
dialog.video-dialog input[type="url"] { width: 100%; }.ql-editor .ac-pdf-embed { position: relative; margin: 1.2em 0; padding: 28px 14px 12px; border: 1.5px dashed var(--line-strong); border-radius: 8px; background: var(--soft); cursor: pointer; }
.ql-editor .ac-pdf-embed::before { content: attr(data-label); position: absolute; top: 7px; left: 14px; color: var(--mut); font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.ql-editor .ac-pdf-embed:hover { border-color: var(--acc); }
.ql-editor .ac-pdf-embed p { margin: 0; font-weight: 600; }
dialog.pdf-dialog { width: min(620px, calc(100vw - 32px)); }
.pdf-dialog .gallery-dialog-body { display: grid; gap: 12px; }
.pdf-or { margin: 4px 0 0; color: var(--mut); font-size: 13px; }
.pdf-chosen { margin: 4px 0 0; font-size: 13px; overflow-wrap: anywhere; }

/* Кнопки панели редактора с подписью; «Изменить» и «Удалить» на вставках. */
.ql-toolbar.ql-snow button.has-text { display: inline-flex; align-items: center; gap: 5px; width: auto; height: 26px; padding: 3px 8px 3px 5px; border-radius: 6px; }
.ql-toolbar.ql-snow button.has-text svg { float: none; width: 18px; height: 18px; flex: none; }
.ql-toolbar.ql-snow button.has-text:hover { background: var(--hover); }
.ql-btn-text { font-size: 12.5px; color: var(--fg); white-space: nowrap; }
.ql-editor .ac-gallery-embed, .ql-editor .ac-docs-embed, .ql-editor .ac-video-embed, .ql-editor .ac-pdf-embed, .ql-editor .ac-html-embed, .ql-editor .ac-form-embed { position: relative; }
/* «HTML-код»: фрагмент, который визуальный редактор не показывает, хранится как есть. */
.ql-editor .ac-html-embed { margin: 1.2em 0; padding: 28px 80px 12px 14px; border: 1.5px dashed var(--line-strong); border-radius: 8px; background: var(--soft); cursor: pointer; }
.ql-editor .ac-html-embed::before { content: attr(data-label); position: absolute; top: 7px; left: 14px; color: var(--mut); font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.ql-editor .ac-html-embed:hover { border-color: var(--acc); }
.ql-editor .ac-html-embed code { display: block; font: 12.5px/1.5 ui-monospace, Consolas, monospace; color: var(--fg); overflow-wrap: anywhere; white-space: pre-wrap; }
dialog.html-dialog { width: min(760px, calc(100vw - 32px)); }
dialog.html-dialog textarea { width: 100%; }
.ac-embed-tools { position: absolute; top: 6px; right: 6px; z-index: 2; display: flex; gap: 4px; }
.ac-embed-tools button { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--card); color: var(--fg); cursor: pointer; }
.ac-embed-tools button svg { width: 16px; height: 16px; }
.ac-embed-tools button:hover { border-color: var(--acc); color: var(--acc-ink); }
.ac-embed-tools button[data-embed="remove"]:hover { border-color: var(--err); background: var(--err-soft); color: var(--err); }
.ql-editor .ac-gallery-embed .ac-embed-tools { top: 8px; right: 8px; }
/* Точки для перетаскивания (как в конструкторе). */
.drag-dots { display: inline-flex; align-items: center; justify-content: center; width: 20px; color: var(--faint); cursor: grab; user-select: none; }
.drag-dots::before { content: "⠿"; font-size: 17px; line-height: 1; }
.drag-dots:hover { color: var(--fg); }
.cat-tree .menu-node { padding-top: 6px; padding-bottom: 6px; }
.cat-tree .state-toggle { margin: 0 4px; }
.sort-status.is-error { color: var(--err); }
/* Меню: место пункта при перетаскивании со сдвигом уровня (влево — выше, вправо — вложить). */
.menu-tree li.is-shifting > .menu-node { border-color: var(--acc); box-shadow: -3px 0 0 var(--acc); }
.sortable-fallback { opacity: .85 !important; }
/* «Выбрать материал»: выбранный материал и окно со списком. */
.article-pick-box { display: grid; gap: 8px; }
.article-pick-current { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--soft); }
.article-pick-current strong { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.article-pick-empty { margin: 0; font-size: 13px; }
dialog.article-picker-dialog { width: min(1100px, calc(100vw - 32px)); height: min(760px, calc(100vh - 32px)); }
.article-picker .list tr.is-selected td { background: var(--acc-soft); }
.article-picker .link-btn.title { padding: 0; border: 0; background: none; color: var(--fg); font: inherit; font-weight: 500; text-align: left; cursor: pointer; }
.article-picker .link-btn.title:hover { color: var(--acc-ink); text-decoration: underline; }

/* Оформление «Облако»: размеры, скругления, тени и полупрозрачность поверх базовых правил. */
body { font-size: 14px; letter-spacing: -.011em; -webkit-font-smoothing: antialiased; background: linear-gradient(180deg, #f7f8fa, #e5e8ee) fixed; }
body * { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
h1, h2, h3 { letter-spacing: -.022em; }
.ic { stroke-width: 1.6; }

/* Меню и верхняя панель */
.side { backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); border-right: 1px solid rgba(0, 0, 0, .06); }
.side::-webkit-scrollbar { width: 6px; }
.side-link { padding: 8px 12px; gap: 12px; border-radius: 10px; font-weight: 500; transition: background .12s, color .12s; }
.side-link[aria-current="page"] .ic { color: var(--acc); }
.side-group { padding: 18px 12px 6px; font-size: 12px; }
.top { height: 60px; border-bottom: 0; padding: 0 32px; background: transparent; position: relative; }
.icon-btn { border-radius: 10px; width: 34px; height: 34px; }
.docs-node-actions .icon-btn { width: 24px; height: 24px; }
.profile-menu, .bulk-pop, .columns-pop { box-shadow: 0 12px 36px rgba(0, 0, 0, .14); border-radius: 16px; padding: 8px; }
.bulk-item, .menu-item { border-radius: 10px; padding: 9px 12px; }

/* Заголовок страницы по центру */
.content { padding: 8px 32px 48px; }
.page-head { gap: 16px; margin-bottom: 24px; align-items: center; text-align: center; padding: 10px 0 6px; }
.page-head h1 { font-size: 34px; font-weight: 700; line-height: 1.1; letter-spacing: -.03em; text-wrap: balance; }
.head-actions { justify-content: center; }

/* Кнопки и поля */
.btn { min-height: 38px; padding: 9px 16px; font-size: 13.5px; border-radius: 99px; font-weight: 500; transition: background .12s, border-color .12s; }
.btn.sm { min-height: 32px; padding: 7px 12px; }
.btn .ic { width: 16px; height: 16px; }
/* Второстепенная кнопка — «серый контур»: белая, серая рамка, тёмный текст (выбрана заказчиком). */
.btn.ghost { background: #fff; border: 1px solid #d2d2d7; box-shadow: none; color: var(--fg); }
.btn.ghost:hover { background: #f5f5f7; border-color: #c7c7cc; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2386868b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") !important; background-repeat: no-repeat !important; background-position: right 12px center !important; cursor: pointer; }
input[type="text"], input[type="email"], input[type="search"], input[type="url"], input[type="date"], input[type="number"], input[type="password"], select, textarea { min-height: 38px; padding-left: 14px; padding-right: 14px; transition: border-color .12s, box-shadow .12s; }
.search input { padding-left: 38px; }
.search .ic { left: 13px; }
.toolbar { padding: 14px 18px; gap: 10px; border-bottom: 0; }
.toolbar input, .toolbar select { border-radius: 10px; background-color: #f2f2f6; border-color: #f2f2f6; }
.state-switch-track { width: 38px; height: 23px; }
.state-switch-knob { width: 19px; height: 19px; }
.state-switch.is-on .state-switch-knob { left: 17px; }
button.state-switch.is-on:hover .state-switch-knob { left: 15px; }

/* Карточки, таблицы, показатели */
.card { border: 0; border-radius: 20px; box-shadow: 0 4px 24px rgba(0, 0, 0, .06); }
.card-head { border-bottom: 0; padding: 20px 24px 8px; }
.card-head h2 { font-size: 19px; letter-spacing: -.018em; }
.side-cards h2 { font-size: 16px; letter-spacing: -.015em; margin-bottom: 14px; }
.list th { background: none; font-weight: 400; padding-top: 12px; padding-bottom: 12px; }
.list td { border-color: #f2f2f6; padding-top: 13px; padding-bottom: 13px; }
.list a.title { font-weight: 500; }
.list tbody tr { transition: background .1s; }
.grid-cards { gap: 20px; margin-bottom: 24px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat { padding: 22px 24px; }
.stat.card { text-align: center; }
.stat .value { font-size: 36px; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; margin-top: 8px; }
.stat .value small { display: block; line-height: 1.35; margin-top: 4px; letter-spacing: 0; font-family: var(--font); }
.stat .label { font-size: 13px; }
.pager [aria-current="page"] { border-radius: 99px; }
.tabs-list { gap: 8px; padding: 0 20px; }
.tabs-list [role="tab"] { padding: 15px 8px 13px; }
.form-actions { background: none; }
.flag { border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06); }
.dropzone { border-radius: 20px; }

/* Значок файла — однотонная плашка своего цвета для каждого типа, как на сайте */
.file-badge { width: auto; min-width: 38px; height: 42px; padding: 0 4px; border-radius: 6px; font-size: 10px; font-weight: 700; line-height: 1; white-space: nowrap; }

/* Документы */
.docs-layout .toolbar { min-height: 66px; }
.docs-tree { padding: 12px; }
.docs-tree .docs-node > .docs-tree-item { padding: 6px 8px 6px 4px; }
.docs-tree-item { border-radius: 10px; }
.docs-tree-item.is-active { background: var(--acc-soft); color: var(--acc-ink); font-weight: 600; }
.docs-handle, .docs-tree-item .docs-handle svg, .docs-folder .docs-tree-item > .docs-panel-ic svg, .docs-panel-ic { color: var(--acc-ink); }
.docs-panel-ic { background: var(--acc-soft); border-radius: 12px; }
.docs-drop { border-radius: 18px; }
.docs-drop-body { padding: 30px 18px; }
.docs-folders, .docs-tiles { gap: 16px; }
.docs-tile, .docs-folder .docs-tree-item { border: 0; border-radius: 18px; background: #f7f7fa; }
.docs-folder .docs-tree-item { padding: 16px; }
.docs-tile { padding: 16px; gap: 14px; }
.docs-tile:hover { background: #fff; box-shadow: 0 6px 20px rgba(0, 0, 0, .08); }
.docs-tile .file-badge { min-width: 50px; height: 56px; font-size: 12px; border-radius: 8px; }
.docs-filebar { background: var(--acc-soft); border-radius: 20px 20px 0 0; }

/* Медиатека */
.media-grid { gap: 20px; padding: 20px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.media-thumb { border: 0; border-radius: 16px; overflow: hidden; }

@media (max-width: 760px) {
    .main { overflow-x: clip; }
    .content { padding: 4px 16px 40px; }
    .top { padding: 0 12px; }
    .page-head h1 { font-size: 27px; }
}

/* Меню и верхняя строка: графитовые плавающие панели, выбранный пункт — синяя капсула, общий фон светло-серый. */
:root { --bg: #f2f2f5; --chrome: #1d1d1f; }
body { background: var(--bg); }
.side {
    margin: 12px 0 12px 12px; height: calc(100vh - 24px); top: 12px; z-index: 30; border: 0; border-radius: 22px;
    background: var(--chrome); color: rgba(255, 255, 255, .8); box-shadow: 0 10px 34px rgba(0, 0, 0, .18);
    overflow-x: hidden; backdrop-filter: none; -webkit-backdrop-filter: none; scrollbar-color: rgba(255, 255, 255, .2) transparent;
}
.side .logo { color: #fff; }
.side .brand .brand-cms { fill: rgba(255, 255, 255, .5); }
.side-group { color: rgba(255, 255, 255, .42); }
.side-link { color: rgba(255, 255, 255, .8); border-radius: 99px; padding-left: 14px; white-space: nowrap; transition: background .15s, color .15s; }
.side-link .ic { color: rgba(255, 255, 255, .6); }
.side-link:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.side-link[aria-current="page"] { background: var(--acc); color: #fff; font-weight: 600; box-shadow: none; }
.side-link[aria-current="page"] .ic { color: #fff; }
.side :focus-visible, .top :focus-visible { outline-color: #4aa3ff; }
.top { position: sticky; top: 12px; z-index: 40; margin: 12px 12px 0 16px; height: 56px; padding: 0 18px; border-radius: 18px; background: var(--chrome); box-shadow: 0 10px 30px rgba(0, 0, 0, .16); }
.top .burger { display: inline-flex; margin-left: -6px; margin-right: 4px; }
.top .icon-btn { color: rgba(255, 255, 255, .82); }
.top .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.top .crumbs, .top .crumbs a, .top .crumbs .crumb-sep { color: rgba(255, 255, 255, .62); }
.top .crumbs a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.top .crumbs .crumb-current { color: #fff; }
.top-site { color: rgba(255, 255, 255, .72); }
.top-site:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.top .langs { background: rgba(255, 255, 255, .1); border-radius: 99px; }
.top .langs button { color: rgba(255, 255, 255, .72); border-radius: 99px; }
.top .langs button[aria-pressed="true"] { background: rgba(255, 255, 255, .92); color: #1d1d1f; }
.top .profile > summary { color: #fff; }
.top .profile > summary:hover { background: rgba(255, 255, 255, .1); }
.content { padding-top: 18px; }

/* Свёрнутое меню (кнопка «три полоски» в верхней строке): колонка значков, подписи при наведении.
   Значок строго по центру (без зазора до скрытой подписи), фон выбранного пункта — квадрат 44 × 44 с отступом 12 px.
   Если пункты не помещаются по высоте, список прокручивается колесом мыши, а внизу и вверху появляется мягкое затухание;
   подпись при наведении рисует admin.js отдельным элементом, чтобы прокрутка её не обрезала. */
@media (min-width: 1024px) {
    body.side-anim .side { transition: width .18s ease; }
    body.side-mini .side { width: 76px; overflow: hidden; }
    body.side-mini .side .logo { justify-content: center; padding: 22px 0 14px; flex: none; }
    body.side-mini .side .brand { width: 26px; overflow: hidden; }
    body.side-mini .side .brand .mark { width: 150px; max-width: none; flex: none; }
    body.side-mini .side nav { padding: 4px 0 12px; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain; }
    body.side-mini .side nav::-webkit-scrollbar { display: none; }
    body.side-mini .side nav.fade-bottom { -webkit-mask-image: linear-gradient(#000 calc(100% - 36px), transparent); mask-image: linear-gradient(#000 calc(100% - 36px), transparent); }
    body.side-mini .side nav.fade-top { -webkit-mask-image: linear-gradient(transparent, #000 36px); mask-image: linear-gradient(transparent, #000 36px); }
    body.side-mini .side nav.fade-top.fade-bottom { -webkit-mask-image: linear-gradient(transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(transparent, #000 36px, #000 calc(100% - 36px), transparent); }
    body.side-mini .side-link { justify-content: center; gap: 0; width: 44px; height: 44px; padding: 0; margin: 4px auto; border-radius: 12px; font-size: 0; }
    body.side-mini .side-link .ic { width: 20px; height: 20px; }
    body.side-mini .side-group { font-size: 0; padding: 0; height: 1px; margin: 10px 16px; background: rgba(255, 255, 255, .12); }
}
.side-tip { position: fixed; z-index: 90; transform: translateY(-50%); padding: 7px 10px; border-radius: 8px; background: var(--chrome); color: #fff; font: 500 12.5px/1 var(--font); white-space: nowrap; box-shadow: 0 6px 18px rgba(0, 0, 0, .2); pointer-events: none; }
@media (max-width: 1023px) {
    .side { margin: 0; height: 100vh; top: 0; z-index: 50; border-radius: 0 22px 22px 0; }
    .top { margin: 8px 8px 0; top: 8px; }
    .editor .ql-toolbar.ql-snow { top: 72px; }
    .editor .ql-toolbar.ql-snow::before { height: 8px; }
}

/* Названия записей в списках и деревьях (материалы, категории, документы, разделы, меню, блоки, формы, пользователи, файлы) — 16 px. */
.content a.title, .content .link-btn.title, .docs-name, .media-name, .media-grid.is-list .media-name { font-size: 16px; }

/* Переключатель состояния: «Опубликован» — зелёный, «Снят с публикации» — красный (решение заказчика). */
.state-switch:not(.is-on) .state-switch-track { background: #e5484d; }

/* Категории: заголовки столбцов над деревом, галочки строк, столбцы фиксированной ширины справа. */
.cat-head { display: flex; align-items: center; gap: 10px; padding: 2px 11px 10px; margin-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--mut); }
.cat-head .cat-title { flex: 1; min-width: 0; }
.cat-check { width: 20px; flex: none; display: inline-flex; align-items: center; }
.cat-langs { width: 120px; flex: none; }
.cat-state { width: 84px; flex: none; display: inline-flex; align-items: center; }
.cat-articles { width: 72px; flex: none; display: inline-flex; justify-content: center; }
.cat-id { width: 40px; flex: none; text-align: right; color: var(--mut); }
.cat-head .cat-id { color: var(--mut); }
.drag-dots.is-head { visibility: hidden; }
/* Пункты меню: те же столбцы, справа — кнопки пункта постоянной ширины, чтобы заголовки совпадали со строками. */
.menu-tree-wrap .menu-node > .row-actions { width: 150px; flex: none; display: inline-flex; justify-content: flex-end; align-items: center; gap: 2px; }
.cat-head .menu-head-actions { width: 150px; flex: none; }
/* Заголовки в деревьях (категории, пункты меню) при наведении — как в списке материалов. */
.menu-node a.title { color: var(--fg); }
.menu-node a.title:hover { color: var(--acc-ink); text-decoration: underline; }

/* Окно выбора категории или раздела документов (partials/list-picker.php). */
dialog.list-pick-dialog { width: min(560px, calc(100vw - 32px)); height: fit-content; max-height: min(640px, calc(100vh - 48px)); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 24px 64px rgba(0, 0, 0, .25); }
.list-pick-dialog::backdrop { background: rgba(20, 20, 22, .4); }
.list-pick-body { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.list-pick-body .search { flex: none; max-width: none; }
.list-pick-items { list-style: none; margin: 0; padding: 0; max-height: 440px; overflow-y: auto; }
.list-pick-items button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 10px; background: none; color: var(--fg); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.list-pick-items button .ic { color: var(--acc-ink); flex: none; }
.list-pick-items button span { flex: 1; min-width: 0; }
.list-pick-items button small { flex: none; }
.list-pick-items button:hover, .list-pick-items button:focus-visible { background: var(--hover); }
.list-pick-items button[aria-current="true"] { background: var(--acc-soft); color: var(--acc-ink); font-weight: 600; }
.list-pick-nothing { padding: 8px 12px; }

/* Медиатека: окно «карандаша» шире, поле имени во всю ширину, внизу «Переименовать» слева и «Удалить» справа;
   счётчик отмеченных — на кнопке «Удалить выбранные». */
.media-menu { width: 320px; gap: 10px; padding: 12px; }
.media-menu .media-rename { display: flex; flex-direction: column; gap: 6px; }
.media-menu .media-rename label { font-size: 12.5px; color: var(--mut); }
.media-menu .media-rename input { width: 100%; }
.media-menu-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.count-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 2px; border-radius: 99px; background: var(--err); color: #fff; font-size: 12px; font-weight: 600; }

/* Документы: дерево разделов — 13 px, «Все документы» как остальные пункты, значки у пункта
   подсвечиваются при наведении; панель справа закрывается крестиком и сворачивается в кнопку у края. */
.docs-tree .docs-name, .docs-tree .docs-rename { font-size: 13px; }
.docs-tree .docs-tree-item { font-size: 13px; }
.docs-default { margin-bottom: 2px; }
.docs-tree .docs-default > .docs-tree-item { padding: 6px 8px 6px 24px; gap: 4px; }
.docs-handle.is-fixed { cursor: default; }
.docs-default > .docs-tree-item:hover .docs-node-actions, .docs-default > .docs-tree-item:focus-within .docs-node-actions { display: inline-flex; }
.docs-default > .docs-tree-item:hover small, .docs-default > .docs-tree-item:focus-within small { display: none; }
.docs-tree-item .docs-node-actions .icon-btn { color: var(--mut); }
.docs-tree-item .docs-node-actions .icon-btn:hover, .docs-tree-item .docs-node-actions .icon-btn:focus-visible { background: var(--card); color: var(--acc-ink); box-shadow: 0 0 0 1px var(--line-strong); }
.docs-tree-item .docs-node-actions .icon-btn.danger:hover { color: var(--err); }
.docs-tree-item:hover .docs-node-actions .icon-btn .ic { color: inherit; }
.docs-tree-hint:empty { display: none; }
.docs-panel .docs-panel-close { position: absolute; top: 10px; right: 10px; z-index: 1; }
.docs-panel .docs-panel-head { padding-right: 36px; }
.docs-panel-toggle { position: fixed; right: 0; top: 50%; z-index: 55; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border: 1px solid var(--line); border-right: 0; border-radius: 12px 0 0 12px; background: var(--card); color: var(--mut); box-shadow: -4px 0 16px rgba(0, 0, 0, .08); cursor: pointer; }
.docs-panel-toggle:hover, .docs-panel-toggle:focus-visible { color: var(--acc-ink); }
.docs-panel-toggle .ic { width: 18px; height: 18px; }
.docs-panel-toggle[hidden] { display: none; }
.docs-date { display: flex; align-items: center; gap: 6px; }
.docs-date input { flex: 1; min-width: 0; min-height: 32px; font-size: 13px; color: var(--fg); }
.docs-date input::-webkit-calendar-picker-indicator { display: none; }
.docs-file-links .sr-only { position: absolute; }
@media (max-width: 1360px) {
    .docs-panel .docs-panel-close { top: 12px; }
}

/* Разделы документов: точки — порядок среди соседей, окно «Переместить» — в другой раздел */
/* Значок папки — ручка перетаскивания. */
.docs-node-drag { cursor: grab; }
.docs-tree.is-dragging .docs-node.is-ghost { opacity: .9; }
.docs-node.is-moved > .docs-tree-item { background: var(--acc-soft); transition: background-color 1s ease; }
.docs-move-dialog .list-pick-body { gap: 10px; }
.docs-move-search { width: 100%; }
.docs-move-dialog .list-pick-items button:disabled { cursor: default; }
.docs-more { display: grid; gap: 2px; padding: 6px; min-width: 220px; }
.docs-more-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--fg); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.docs-more-item .ic { width: 16px; height: 16px; color: var(--mut); flex: none; }
.docs-more-item:hover, .docs-more-item:focus-visible { background: var(--hover); outline: none; }
.docs-more-item.danger, .docs-more-item.danger .ic { color: var(--err); }

/* Окно ссылки визуального редактора: подписи на языке интерфейса, широкое поле адреса, «Изменить название» */
.ql-snow .ql-tooltip.ac-tt { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; width: min(520px, calc(100% - 16px)); white-space: normal; padding: 6px 12px; border-radius: 10px; border-color: var(--line-strong); box-shadow: 0 8px 24px rgba(0, 0, 0, .12); z-index: 20; }
.ql-snow .ql-tooltip.ac-tt.ql-hidden { display: none; }
.ql-snow .ql-tooltip.ac-tt::before { content: attr(data-l-visit); flex: none; }
.ql-snow .ql-tooltip.ac-tt.ql-editing::before { content: attr(data-l-enter); }
.ql-snow .ql-tooltip.ac-tt.ac-renaming::before { content: attr(data-l-name); }
/* Первая строка — подпись и адрес, вторая — действия. */
.ql-snow .ql-tooltip.ac-tt a.ql-preview { flex: 1 1 calc(100% - 90px); min-width: 0; max-width: none; white-space: nowrap; }
.ql-snow .ql-tooltip.ac-tt input[type=text] { flex: 1 1 calc(100% - 140px); min-width: 0; width: auto; height: 30px; border-radius: 6px; border-color: var(--line-strong); font-size: 14px; }
.ql-snow .ql-tooltip.ac-tt a.ql-action::after { content: attr(data-l-edit); margin-left: 0; }
.ql-snow .ql-tooltip.ac-tt.ql-editing a.ql-action::after { margin-left: 10px; }
.ql-snow .ql-tooltip.ac-tt.ql-editing a.ql-action::after { content: attr(data-l-save); }
.ql-snow .ql-tooltip.ac-tt a.ql-remove::before { content: attr(data-l-remove); }
.ql-snow .ql-tooltip.ac-tt .ac-ql-rename { margin-left: 8px; padding-right: 8px; border-right: 1px solid #ccc; white-space: nowrap; }
.ql-snow .ql-tooltip.ac-tt a.ql-action, .ql-snow .ql-tooltip.ac-tt a.ql-remove { white-space: nowrap; }
.ql-snow .ql-tooltip.ac-tt .ac-ql-name-save { display: none; margin-left: 12px; white-space: nowrap; }
.ql-snow .ql-tooltip.ac-tt.ql-editing .ac-ql-rename { display: none; }
.ql-snow .ql-tooltip.ac-tt.ac-renaming > a.ql-preview, .ql-snow .ql-tooltip.ac-tt.ac-renaming > a.ql-action, .ql-snow .ql-tooltip.ac-tt.ac-renaming > a.ql-remove, .ql-snow .ql-tooltip.ac-tt.ac-renaming > .ac-ql-rename { display: none; }
.ql-snow .ql-tooltip.ac-tt.ac-renaming > input.ac-ql-name { display: inline-block; }
.ql-snow .ql-tooltip.ac-tt.ac-renaming > .ac-ql-name-save { display: inline; }
.ql-snow .ql-tooltip.ac-tt.ql-editing > input.ac-ql-name { display: none; }

/* Настройки → «Типографика»: поля слева, образец справа (на узком экране — под полями) */
.ty-intro { margin: 0 0 16px; max-width: 80ch; }
.ty-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 400px); gap: 24px; align-items: start; }
.ty-group { margin: 18px 0 10px; font-size: 14px; font-weight: 600; }
.ty-fields > .ty-group:first-child { margin-top: 0; }
.ty-color { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ty-color input[type="color"] { width: 64px; height: 36px; padding: 2px; }
.ty-color-value { font-size: 13px; color: var(--mut); }
.ty-preview { position: sticky; top: 88px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; color: #111; }
.ty-preview-label { display: block; margin-bottom: 10px; font-size: 12px; font-weight: 600; color: var(--mut); text-transform: uppercase; letter-spacing: .04em; }
.ty-sample { font-size: 16px; line-height: 1.6; }
.ty-sample h1, .ty-sample h2, .ty-sample h3, .ty-sample h4 { margin: 0 0 10px; line-height: 1.15; }
.ty-sample h1 { font-size: 32px; } .ty-sample h2 { font-size: 24px; } .ty-sample h3 { font-size: 19px; } .ty-sample h4 { font-size: 16px; }
.ty-sample p { margin: 0 0 12px; }
.ty-sample a { color: #0066cc; }
@media (max-width: 1100px) { .ty-layout { grid-template-columns: minmax(0, 1fr); } .ty-preview { position: static; } }

/* Форма материала: поле «Галерея» — миниатюры с описанием и стрелками порядка */

/* Отступ над закреплённой шапкой: прокручиваемая страница не видна между шапкой и верхом окна.
   Полоса цвета фона закреплена вместе с шапкой и лежит под ней, закрывая и места у скруглённых углов. */
.main::before { content: ""; display: block; position: sticky; top: 0; z-index: 39; height: 32px; margin-bottom: -32px; background: var(--bg); pointer-events: none; }

/* Выбор нескольких файлов в медиатеке */
.media-item.is-picked .media-thumb { outline: 3px solid var(--acc); outline-offset: -3px; }
.media-item.is-picked::after { content: "✓"; position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--acc); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; pointer-events: none; }
.media-pick-bar { position: sticky; bottom: 12px; z-index: 30; margin: 16px auto 0; width: fit-content; display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 18px; border-radius: 14px; background: var(--chrome); color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.2); }

/* Изображения материала: одна сетка, звёздочка — основное фото */
.article-images { display: grid; gap: 10px; border-radius: 12px; }
.article-images.is-over { outline: 2px dashed var(--acc); outline-offset: 4px; }
.article-images .hint { margin: 0; }
.article-images-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.article-images-grid li { position: relative; display: grid; gap: 4px; align-content: start; align-self: start; cursor: grab; min-width: 0; }
.article-images-grid li.is-ghost { opacity: .4; }
.article-images-grid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--soft); }
.article-images-grid li.is-main img { outline: 3px solid var(--acc); outline-offset: -3px; }
.article-images-main { position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 7px; border: 0; border-radius: 6px; background: rgba(255, 255, 255, .92); color: #8e8e93; font: 600 11px/1 var(--font); cursor: pointer; }
.article-images-main span[aria-hidden] { font-size: 13px; }
.article-images-main .t { display: none; white-space: nowrap; }
.article-images-main:hover, .article-images-main:focus-visible { color: var(--acc); }
.article-images-main:hover .t, .article-images-main:focus-visible .t, .article-images-main[aria-pressed="true"] .t { display: inline; }
.article-images-main[aria-pressed="true"] { background: var(--acc); color: #fff; cursor: default; }
.article-images-tools { position: absolute; top: 5px; right: 5px; display: flex; gap: 2px; background: rgba(255, 255, 255, .92); border-radius: 7px; padding: 1px; }
.article-images-tools .icon-btn { width: 24px; height: 24px; font-size: 14px; }
.article-images-add { cursor: default !important; }
.article-images-add button { width: 100%; aspect-ratio: 1; display: grid; place-items: center; border: 1.5px dashed var(--line-strong, #c7c7cc); border-radius: 8px; background: transparent; color: var(--mut); font-size: 24px; cursor: pointer; }
.article-images-add button:hover { border-color: var(--acc); color: var(--acc); }

/* Кнопки формы в шапке: появляются, когда кнопки над формой ушли из вида при прокрутке */
.top-actions { display: none; align-items: center; gap: 6px; flex: none; }
.top-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px 0 11px; border: 0; border-radius: 99px; background: #3a3a3c; color: #fff; font: 500 13px/1 var(--font); white-space: nowrap; cursor: pointer; text-decoration: none; }
.top-btn svg { width: 16px; height: 16px; flex: none; }
.top-btn:hover { color: #fff; }
.top-btn:hover { background: #48484a; }
.top-btn.is-primary { background: var(--acc); }
.top-btn.is-primary:hover { background: #0077ed; }
.top-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
body.has-top-actions .top-actions { display: flex; animation: top-actions-in .2s ease; }
body.has-top-actions .top .langs, body.has-top-actions .top .profile, body.has-top-actions .top .top-site { display: none; }
@keyframes top-actions-in { from { opacity: 0; transform: translateY(-4px); } }
@media (max-width: 900px) { .top-btn:not(.is-primary) { display: none; } }
@media (prefers-reduced-motion: reduce) { body.has-top-actions .top-actions { animation: none; } }

/* ---------- Документы: окно «Настройки разделов», бросание файлов на всю страницу ---------- */
dialog.docs-defaults { border: 0; border-radius: 20px; padding: 0; width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow: hidden; background: var(--card); color: var(--fg); box-shadow: 0 24px 64px rgba(0, 0, 0, .25); }
dialog.docs-defaults::backdrop { background: rgba(20, 20, 18, .45); }
.docs-defaults > form { gap: 12px; padding: 20px 22px 18px; max-height: calc(100vh - 32px); }
.docs-defaults .modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.docs-defaults .modal-head h2 { margin: 0; font-size: 19px; font-weight: 600; }
.docs-defaults .docs-panel-hint { margin: 0; font-size: 13px; }
.docs-defaults-body { overflow-y: auto; min-height: 0; padding-right: 4px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 22px; align-items: start; }
.docs-defaults-body .docs-displays { grid-row: span 2; grid-template-columns: 1fr 1fr 1fr; }
.docs-defaults-body .docs-panel-group { display: flex; flex-direction: column; gap: 6px; }
.docs-defaults .modal-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding-top: 6px; border-top: 1px solid var(--line); }
.docs-defaults-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 12px; border-radius: 12px; background: var(--err-soft); font-size: 13px; }
.docs-defaults-ask span { flex: 1 1 260px; }
.docs-defaults-ask[hidden] { display: none; }
@media (max-width: 640px) {
    .docs-defaults-body { grid-template-columns: minmax(0, 1fr); }
    .docs-defaults-body .docs-displays { grid-row: auto; }
}
.docs-page-drop { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 24px; background: color-mix(in srgb, var(--acc) 14%, rgba(242, 242, 245, .82)); backdrop-filter: blur(2px); pointer-events: none; }
.docs-page-drop[hidden] { display: none; }
.docs-page-drop::before { content: ""; position: absolute; inset: 14px; border: 2px dashed var(--acc); border-radius: 22px; }
.docs-page-drop-box { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 34px; border-radius: 20px; background: var(--card); box-shadow: 0 18px 50px rgba(0, 0, 0, .18); text-align: center; color: var(--mut); font-size: 14px; }
.docs-page-drop-box strong { color: var(--fg); font-size: 20px; font-weight: 600; }
.docs-page-drop-box .docs-drop-ic { color: var(--acc); }
.docs-page-drop-box .docs-drop-ic svg { width: 40px; height: 40px; }
/* Новый раздел в плитках: пока вводится название, карандаш и корзина не нужны. */
.docs-folder .docs-tree-item:has(.docs-rename) .docs-folder-actions { display: none; }
/* Окно «Документ»: отмеченные документы и способ вставки. */
.docs-choice-check { flex: none; width: 18px; height: 18px; border: 1.5px solid var(--line-strong); border-radius: 5px; background: var(--card); }
.docs-choice[aria-pressed="true"] { border-color: var(--acc); background: var(--acc-soft); }
.docs-choice[aria-pressed="true"] .docs-choice-check { border-color: var(--acc); background: var(--acc) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5l10 -10'/%3E%3C/svg%3E") center / 12px no-repeat; }
.docs-pick-foot { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.docs-picked-info { margin-right: auto; align-self: center; font-size: 13px; font-weight: 500; color: var(--mut); }
.docs-pick-mode { margin: 0; }
.docs-pick-mode select { width: auto; }

/* Размер изображения в редакторе: рамка с точками, подсказка, карандаш, окно */
.ql-editor img.ac-img-full { display: block; width: 100%; height: auto; }
.img-size-box { position: absolute; z-index: 5; outline: 2px solid var(--acc); outline-offset: 0; pointer-events: none; box-sizing: border-box; }
.img-size-dot { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--acc); pointer-events: auto; touch-action: none; }
.img-size-dot.is-nw { left: -7px; top: -7px; cursor: nwse-resize; }
.img-size-dot.is-ne { right: -7px; top: -7px; cursor: nesw-resize; }
.img-size-dot.is-sw { left: -7px; bottom: -7px; cursor: nesw-resize; }
.img-size-dot.is-se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.img-size-edit { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .95); color: #1d1d1f; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); cursor: pointer; pointer-events: auto; }
.img-size-edit:hover { background: #fff; color: var(--acc); }
.img-size-edit svg { width: 18px; height: 18px; }
.img-size-tip { position: absolute; padding: 3px 8px; border-radius: 6px; background: #1d1d1f; color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; }
.img-size-tip.is-se { right: -8px; bottom: -34px; }
.img-size-tip.is-sw { left: -8px; bottom: -34px; }
.img-size-tip.is-ne { right: -8px; top: -34px; }
.img-size-tip.is-nw { left: -8px; top: -34px; }
dialog.img-size-dialog { width: min(480px, calc(100vw - 32px)); }
.img-size-fields { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.img-size-fields .field { margin: 0; width: 120px; }
.img-size-fields input { width: 100%; }
.img-size-x { padding-bottom: 9px; color: var(--mut); }

/* Форма в тексте: плашка-метка и окно выбора */
.ql-editor .ac-form-embed { margin: 1.2em 0; padding: 28px 14px 12px; border: 1.5px dashed var(--line-strong); border-radius: 8px; background: var(--soft); cursor: pointer; }
.ql-editor .ac-form-embed::before { content: attr(data-label); position: absolute; top: 7px; left: 14px; color: var(--mut); font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.ql-editor .ac-form-embed:hover { border-color: var(--acc); }
.ql-editor .ac-form-embed p { margin: 0; font-weight: 600; }
.ql-editor .ac-form-embed a { color: inherit; text-decoration: none; pointer-events: none; }
dialog.form-embed-dialog { width: min(520px, calc(100vw - 32px)); }
.form-embed-list { display: grid; gap: 4px; max-height: 50vh; overflow: auto; }
.form-embed-item { padding: 8px 10px; border-radius: 8px; }
.form-embed-item:hover { background: var(--hover); }

/* Страница «Блоки»: схема страницы. Ряд — оранжевая метка, место (позиция) — синяя, блок — зелёная. */
.bl-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 12px 16px; margin-bottom: 8px; }
.bl-check { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13px; white-space: nowrap; }
.bl-check select { min-width: 240px; }
.bl-check-hint { font-size: 13px; }
.bl-phone { margin-left: auto; }
.bl-status { font-size: 13px; color: var(--mut); min-width: 90px; text-align: right; }
.bl-status.is-error { color: var(--err); }
.bl-schema { display: grid; gap: 0; }
.bl-insert { display: flex; justify-content: center; padding: 4px 0; }
.bl-insert-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px dashed transparent; background: none; color: var(--mut); font: inherit; font-size: 12.5px; padding: 3px 12px; border-radius: 999px; cursor: pointer; opacity: .55; }
.bl-insert-btn svg { width: 14px; height: 14px; }
.bl-insert:hover .bl-insert-btn, .bl-insert-btn:focus-visible { opacity: 1; border-color: #e8590c; color: #e8590c; }
.bl-row { background: var(--card); border: 1px solid var(--line); border-left: 4px solid #e8590c; border-radius: var(--r-card); padding: 12px 14px 14px; display: grid; gap: 10px; }
.bl-row.is-fixed { border-left-color: var(--line-strong); }
.bl-row.is-orphans { border-left-color: var(--warn); margin-top: 12px; }
.bl-row.bl-bg-accent { background: color-mix(in srgb, var(--acc) 10%, var(--card)); }
.bl-row.bl-bg-dark { background: color-mix(in srgb, #111 8%, var(--card)); }
.bl-row-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.bl-row-head h2 { margin: 0; font-size: 15px; }
.bl-row-label { font: inherit; font-weight: 600; font-size: 15px; border: 1px solid transparent; border-radius: 6px; padding: 4px 8px; background: transparent; width: auto; flex: 0 1 260px; min-width: 140px; color: #c2410c; }
.bl-row-label:hover, .bl-row-label:focus { border-color: var(--line-strong); background: var(--card); }
.bl-row-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-left: auto; font-size: 13px; }
.bl-row-tools select { padding-block: 4px; }
.bl-row-delete { display: inline; margin: 0; }
.bl-inline { display: inline-flex; align-items: center; gap: 6px; }
.bl-inline > span { color: var(--mut); }
.bl-row-hint { margin: 0; font-size: 12.5px; }
.bl-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; }
.bl-col { grid-column: span var(--span, 12); min-width: 0; display: grid; }
.bl-material { align-content: center; justify-items: center; text-align: center; gap: 4px; min-height: 96px; padding: 16px; border-radius: 10px; background: var(--soft); border: 1px solid var(--line); }
.bl-material .mut { font-size: 12.5px; }
.bl-stub { padding: 8px 12px; border-radius: 8px; background: var(--soft); color: var(--mut); font-size: 12.5px; }
.bl-zone { border: 1.5px dashed color-mix(in srgb, #0071e3 45%, transparent); border-radius: 10px; padding: 8px; display: grid; gap: 6px; align-content: start; background: color-mix(in srgb, #0071e3 3%, transparent); }
.bl-zone-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12.5px; font-weight: 600; color: #0058b0; min-width: 0; }
.bl-zone-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-zone-head code { font-size: 11px; color: var(--mut); font-weight: 400; }
.bl-zone.is-compact .bl-zone-head code { display: none; }
.bl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; min-height: 34px; }
.bl-chip { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 4px; border-radius: 8px; background: var(--card); border: 1px solid color-mix(in srgb, #2b8a3e 40%, var(--line)); border-left: 3px solid #2b8a3e; cursor: grab; min-width: 0; transition: opacity .15s; }
.bl-chip.is-off { border-left-color: var(--line-strong); }
.bl-chip.is-ghost { opacity: .4; }
.bl-chip.is-not-here { opacity: .35; }
.bl-chip .bl-not-here { display: none; }
.bl-chip.is-not-here .bl-not-here { display: inline; }
.bl-grip { color: var(--faint); display: grid; }
.bl-grip svg { width: 14px; height: 14px; }
.bl-chip-body { display: grid; min-width: 0; flex: 1; }
.bl-chip-title { font-weight: 600; font-size: 13.5px; color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-chip-title:hover { color: var(--acc); }
.bl-chip small { color: var(--mut); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-add { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--mut); text-decoration: none; justify-self: start; padding: 2px 4px; border-radius: 6px; }
.bl-add svg { width: 13px; height: 13px; }
.bl-add:hover { color: var(--acc); }
.bl-phone-note { display: none; justify-self: start; }
/* Вид «Как на телефоне»: всё в одну колонку, материал первым, скрытые ряды бледные. */
.bl-schema.is-phone { max-width: 420px; margin-inline: auto; }
.bl-schema.is-phone .bl-grid { grid-template-columns: minmax(0, 1fr); }
.bl-schema.is-phone .bl-col, .bl-schema.is-phone .bl-content-grid .bl-material { grid-column: auto !important; }
.bl-schema.is-phone .bl-material { order: -1; }
.bl-schema.is-phone .bl-row-tools, .bl-schema.is-phone .bl-insert { display: none; }
.bl-schema.is-phone .bl-row.is-desktop { opacity: .45; }
.bl-schema.is-phone .bl-row.is-desktop .bl-phone-note { display: inline-flex; }
@media (max-width: 900px) {
    .bl-grid { grid-template-columns: minmax(0, 1fr); }
    .bl-col, .bl-content-grid .bl-material { grid-column: auto !important; }
    .bl-phone { margin-left: 0; }
}

.bl-chip-delete { display: inline; margin: 0; }
