/* Палитра — та же, что у сайта: почти чёрный, молочный фон, тёплый белый карточек, золото для кнопок */
:root { --ink: #1d1a17; --ink-2: #3d3831; --muted: #6b655c; --line: #e6decf; --line-strong: #d3c9b4; --bg: #f6f1e8; --paper: #fffdf9; --sand-2: #efe8da;
  --accent: #8f6f36; --accent-hover: #7c5f2c; --accent-ink: #806536; --accent-soft: #f3ecdd; --gold: #b7965f; --sage: #57634a; --sage-soft: #e9ede3; --warn: #8a5a00; --radius: 12px; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--accent-ink); }
h1 { font-size: 26px; margin: 8px 0 16px; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 20px 0 8px; }
.muted { color: var(--muted); font-weight: 400; }
.lead { max-width: 820px; }
.break { word-break: break-all; }
.top { display: flex; align-items: center; gap: 24px; padding: 10px 24px; background: var(--ink); color: #fff; flex-wrap: wrap; }
.top a { color: #fff; text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.01em; }
.brand img { width: 28px; height: 28px; border-radius: 50%; background: #fff; }
.brand span { color: var(--gold); font-weight: 600; }
.nav-wide { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.top nav a { padding: 6px 10px; border-radius: 8px; opacity: .85; white-space: nowrap; }
.top nav a.is-active, .top nav a:hover { background: rgb(183 150 95 / 22%); opacity: 1; }
.menu { display: none; }
.me { display: flex; gap: 12px; align-items: center; }
.me form { margin: 0; }
.link { background: none; border: 0; color: #fff; opacity: .8; cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 16px 24px 64px; }
.btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--ghost { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--bg); border-color: var(--ink); }
.btn--accent-soft { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-ink); }
.btn--sm { min-height: 32px; padding: 0 10px; font-size: 14px; }
/* Поля не шире колонки: длинный вариант в списке («Qwen3 235B — лучше всех ведёт разговор…») растягивал страницу вбок на телефоне */
input, select, textarea { max-width: 100%; min-width: 0; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); min-height: 40px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { width: 100%; resize: vertical; }
label { display: grid; gap: 4px; font-weight: 600; }
label.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; }
.stack { display: grid; gap: 14px; max-width: 760px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 14px; }
form.toolbar { padding: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
form.toolbar input[type=search], form.toolbar input[name=q] { flex: 1 1 260px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 0 0 16px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: 16px; align-items: start; }
.grid2 > *, .form-grid > * { min-width: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 0 0 16px; }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--ink); display: grid; gap: 2px; transition: border-color .15s, box-shadow .15s; }
.tile b { font-size: 28px; line-height: 1.15; font-variant-numeric: tabular-nums; } .tile span { color: var(--muted); font-size: 14px; }
a.tile:hover { border-color: var(--line-strong); box-shadow: 0 3px 12px rgb(0 0 0 / 6%); }
.tile--accent { border-color: #e8d3a3; background: #fdf7ea; } .tile--accent b { color: var(--accent-ink); }
.tile--warn b { color: #8a2f1c; }
/* Плитки поменьше — для сводки по каналам внутри карточки («Бот»): несколько рядов под подписями */
.tiles--sm { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0 0 14px; }
.tiles--sm .tile { padding: 12px 14px; } .tiles--sm .tile b { font-size: 22px; } .tiles--sm .tile span { font-size: 13px; }
.tiles-title { margin: 14px 0 8px; font-weight: 700; font-size: 14px; } .tiles-title .muted { font-weight: 400; }
/* Метки-факты переносятся на новую строку и на телефоне (обычные .chips там превращаются в прокручиваемую ленту фильтров) */
.chips.chips--facts { align-items: center; flex-wrap: wrap; overflow: visible; margin: 0 0 4px; padding: 0; -webkit-mask-image: none; mask-image: none; }
.chips--facts .chip { white-space: normal; }
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 0 0 16px; }
th, td { text-align: left; padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: top; }
th { background: var(--sand-2); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-top: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: #fffaf1; }
td a:not(.btn) { color: var(--ink); text-decoration: none; }
td a:not(.btn):hover { color: var(--accent-ink); text-decoration: underline; }
td .muted { font-size: 13px; }
tr.is-off td { opacity: .55; }
tr.is-new td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
td.actions form { margin: 0; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 700; background: var(--sand-2); color: var(--ink-2); white-space: nowrap; }
.badge--on { background: var(--sage-soft); color: var(--sage); }
.badge--warn { background: #fbecd0; color: var(--warn); }
.badge--off { background: #f3dcd6; color: #8a2f1c; }
/* Статусы заявок: плашка с точкой, как у постов канала */
.badge[class*="status-"] { display: inline-flex; align-items: center; gap: 5px; }
.badge[class*="status-"]::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.status-new { background: var(--accent-soft); color: var(--accent-ink); }
.status-in_progress { background: #fbecd0; color: var(--warn); }
.status-no_answer { background: #f3e6dc; color: #8a4b1c; }
.status-meeting { background: #dfe9f3; color: #2d5a86; }
.status-deal { background: var(--sage-soft); color: var(--sage); }
.status-spam, .status-rejected { background: #e8e5e0; color: #5c574f; }
.flash { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); }
.flash--ok { border-color: #c9d3c0; background: var(--sage-soft); }
.flash--warn { border-color: #e8d3a3; background: #fbf3e0; }
.flash--error { border-color: #e4b8ad; background: #fbece8; }
.auth { max-width: 380px; margin: 10vh auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }
.history { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 14px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 0 0 12px; }
.photo { display: grid; gap: 6px; font-weight: 400; }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--bg); display: block; }
.photo > span { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); }
.photo input { margin: 0; }
.photo.is-hidden img { opacity: .35; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 4px 0 16px; color: var(--muted); font-size: 14px; }
.pager a { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); text-decoration: none; font-weight: 600; }
.pager a:hover { border-color: var(--ink-2); }
.secret { font-size: 17px; letter-spacing: .05em; background: var(--bg); padding: 2px 6px; border-radius: 6px; }
.qr { display: inline-block; margin: 10px 0; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; line-height: 0; }
.qrlogin { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.qrlogin .qr { margin: 0; }
.qrlogin .qr svg { width: 220px; height: 220px; }
.qrlogin__note:empty { display: none; }
.qrlogin__note { margin: 0; text-align: center; color: var(--ink); font-weight: 600; font-size: 14px; }
.qrlogin.is-off .qr { opacity: .25; }
.yid { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; max-width: 280px; min-height: 48px; padding: 0 18px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 600; font-size: 16px; text-decoration: none; transition: background .15s; }
.yid:hover, .yid:focus-visible { background: var(--ink-2); }
.yid__logo { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #fc3f1d; color: #fff; font-weight: 700; font-size: 15px; line-height: 1; }
/* Телефон: свой экран не отсканировать — QR прячем, остаётся одна крупная кнопка Яндекс ID */
@media (max-width: 700px) and (pointer: coarse) {
  .qrlogin .qr { display: none; }
  .yid { max-width: none; min-height: 54px; font-size: 17px; }
}
.auth__password { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.qrlogin__device { margin: 8px 0 12px; padding-left: 18px; }
.steps { padding-left: 20px; display: grid; gap: 8px; }
pre { white-space: pre-wrap; word-break: break-word; font-size: 12px; max-width: 520px; }

/* Вкладки — сегменты-чипы, как фильтры в «Канале» */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.tabs a { padding: 6px 14px; text-decoration: none; color: var(--ink-2); border: 1px solid var(--line); border-radius: 20px; background: var(--paper); white-space: nowrap; font-size: 14px; }
.tabs a:hover { border-color: var(--ink-2); }
.tabs a.is-active { color: #fff; background: var(--ink); border-color: var(--ink); font-weight: 600; }
.tabs-wrap { position: relative; }
.head-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 0 0 14px; }
.head-row h1 { margin: 0; }
h1 .muted { font-weight: 500; }
.card > h2:first-child { margin-top: 0; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 0 10px; }
.section-head h2 { margin: 0; }
.section-head a { font-size: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 16px 20px; }
.field { display: grid; gap: 4px; align-content: start; }
.field small { font-weight: 400; }
.field .badge, .field .check { justify-self: start; }
.field--wide { grid-column: 1 / -1; }
.field__label { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* Форма настроек: подразделы с заголовком, кнопка сохранения всегда под рукой */
.settings-form { padding: 4px 20px 0; }
.section { border: 0; margin: 0; padding: 18px 0 22px; border-bottom: 1px solid var(--line); min-width: 0; }
.section:last-of-type { border-bottom: 0; }
.section__title { font-size: 16px; font-weight: 800; padding: 0; margin: 0 0 4px; }
.section__desc { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.section .form-grid { margin-top: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }  /* две колонки: auto-fit с широкими полями оставлял пустые треки */
.form-actions { position: sticky; bottom: 0; box-shadow: 0 -8px 16px -12px rgb(29 26 23 / 25%); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 -20px; padding: 14px 20px; background: var(--paper); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
/* Переключатель: подпись и пояснение справа от тумблера */
.switch { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start; font-weight: 400; cursor: pointer; padding: 4px 0; }
.switch input[type=checkbox] { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track { position: relative; width: 44px; height: 26px; border-radius: 13px; background: var(--line-strong); transition: background .15s; margin-top: 1px; }
.switch__track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 25%); transition: transform .15s; }
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch__text { display: grid; gap: 2px; } .switch__text b { font-weight: 700; } .switch__text small { color: var(--muted); font-weight: 400; }
.check--sm { font-size: 13px; color: var(--muted); }
.check { font-weight: 400; display: inline-flex; gap: 6px; align-items: center; }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; line-height: 1.55; }
.help { font-weight: 400; margin: 4px 0; }
.help pre { background: var(--bg); padding: 10px; border-radius: 8px; max-width: none; }
.btn--danger { background: #8a2f1c; border-color: #8a2f1c; }
.danger-zone { margin-top: 8px; padding: 12px; border: 1px dashed #d9b3a8; border-radius: 10px; }
.input-sm { width: 150px; min-height: 32px; padding: 4px 8px; }
.inline-edit summary { cursor: pointer; color: var(--accent-ink); margin-top: 6px; }
.inline-edit form { margin-top: 8px; min-width: 240px; }
.brand-preview { display: grid; place-items: center; min-height: 120px; background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 50% / 16px 16px; border-radius: 10px; margin: 0 0 12px; padding: 12px; }
.brand-preview img { max-height: 160px; max-width: 100%; }
.preview { max-width: 860px; }
.preview table { border-radius: 8px; }
input[type=file] { max-width: 100%; }

/* Планшеты: меню сворачивается */
@media (max-width: 1100px) {
  .nav-wide { display: none; }
  /* Меню раскрывается прямо в шапке на всю ширину — не уходит за край экрана */
  /* Одна строка: логотип слева, «Меню» справа; шапка прилипает к верху. Имя и «Выйти» — внутри меню */
  .top { position: sticky; top: 0; z-index: 50; flex-wrap: nowrap; justify-content: space-between; min-height: 56px; }
  .me { display: none; }
  .menu { display: block; }
  .menu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid rgb(255 255 255 / 30%); border-radius: 10px; font-weight: 600; user-select: none; }
  .menu summary::-webkit-details-marker { display: none; }
  .menu[open] summary { background: rgb(255 255 255 / 12%); }
  .menu__icon, .menu__icon::before, .menu__icon::after { display: block; width: 16px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .15s, opacity .15s; }
  .menu__icon { position: relative; }
  .menu__icon::before, .menu__icon::after { content: ""; position: absolute; left: 0; }
  .menu__icon::before { top: -5px; }
  .menu__icon::after { top: 5px; }
  .menu[open] .menu__icon { background: transparent; }
  .menu[open] .menu__icon::before { transform: translateY(5px) rotate(45deg); }
  .menu[open] .menu__icon::after { transform: translateY(-5px) rotate(-45deg); }
  /* Панель выпадает поверх страницы на всю ширину, не сдвигая содержимое */
  .menu__panel { position: absolute; left: 0; right: 0; top: 100%; background: var(--ink); padding: 8px 12px 14px; box-shadow: 0 12px 24px rgb(0 0 0 / 25%); max-height: calc(100vh - 56px); overflow-y: auto; }
  .menu__panel nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; }
  .menu nav a { padding: 12px; background: rgb(255 255 255 / 6%); }
  .menu__me { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgb(255 255 255 / 14%); }
  .menu__me a { opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .menu__me form { margin: 0; }
}
/* Телефоны: таблицы — карточками, формы в одну колонку */
@media (max-width: 760px) {
  .wrap { padding: 12px 12px 48px; }
  h1 { font-size: 22px; }
  .top { gap: 8px; padding: 8px 12px; }
  .brand span { display: none; } /* «админка» — на телефоне лишнее слово в шапке */
  table:not(.responsive) { display: block; overflow-x: auto; }
  table.responsive, table.responsive tbody, table.responsive tr, table.responsive td { display: block; width: 100%; }
  table.responsive { border: 0; background: none; }
  table.responsive thead { display: none; }
  table.responsive tr { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 10px; padding: 6px 0; }
  table.responsive td { border: 0; padding: 6px 14px; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; }
  table.responsive td::before { content: attr(data-label); color: var(--muted); font-size: 13px; }
  table.responsive td:not([data-label]) { grid-template-columns: 1fr; }
  table.responsive td:not([data-label])::before { content: none; }
  .grid2, .form-grid, .section .form-grid { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 8px; }
  .toolbar > * { flex: 1 1 140px; }
  .tiles { grid-template-columns: 1fr 1fr; }
  /* Вкладки уезжают вправо — растворяем край, чтобы было видно, что их можно листать */
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); padding-right: 40px; }
  .tabs::-webkit-scrollbar { display: none; }
  .btn--sm { min-height: 40px; }
  .top .link { min-height: 40px; }
  .photos { grid-template-columns: repeat(2, 1fr); }
  table.responsive td { grid-template-columns: 96px minmax(0, 1fr); }
  pre { max-width: none; }
  .auth { margin: 24px auto; padding: 20px; }
  .card { padding: 16px; }
  .settings-form { padding: 0 14px; }
  .form-actions { margin: 0 -14px; padding: 12px 14px; }
  .form-actions .btn { flex: 1 1 auto; justify-content: center; }
  .form-actions .muted { display: none; }
  .input-sm { width: 100%; }
}

/* Редактор вопросов и ответов (настройки → тексты) */
.faq-editor__list { display: grid; gap: 10px; margin: 8px 0 12px; }
.faq-item { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.faq-item__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.faq-item__tools { display: flex; gap: 6px; }
.faq-item__tools .btn { min-width: 34px; padding-inline: 8px; }
.faq-item__tools .btn:disabled { opacity: .35; cursor: default; }
.faq-item input, .faq-item textarea { background: var(--paper); }
.faq-item input { font-weight: 600; }

/* ——— Сводка ——— */
.dash-block { margin: 0 0 20px; }
.plist__item--lead { justify-content: space-between; }
.plist__when { font-size: 13px; white-space: nowrap; }
.mini { list-style: none; margin: 8px 0 0; padding: 0; display: grid; }
.mini li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.mini li:first-child { border-top: 0; }
.mini a { flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--ink); text-decoration: none; min-width: 0; }
.mini li > * { min-width: 0; }
.mini a:hover .mini__title { color: var(--accent-ink); }
.mini .dot { margin-right: 2px; }
.mini__title { flex-basis: 100%; min-width: 0; width: 0; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 14px; }
.card h3 { margin: 18px 0 4px; font-size: 14px; }

/* ——— Канал MAX: календарь, список, редактор, предпросмотр ——— */
.rub-market { --rub: #5b7c99; } .rub-zhk { --rub: #8a6d3b; } .rub-safety { --rub: #8a2f1c; } .rub-mortgage { --rub: #4c7a4c; }
.rub-cases { --rub: #6b4c8a; } .rub-voice { --rub: #b5651d; } .rub-selection { --rub: #9a7b2f; } .rub-city { --rub: #3d6b8f; }
.rub-site { --rub: #2f6f73; }
b.rub-market, b.rub-zhk, b.rub-safety, b.rub-mortgage, b.rub-cases, b.rub-voice, b.rub-selection, b.rub-city, b.rub-site { color: var(--rub); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 0 0 14px; }
.page-head h1 { margin: 0 0 4px; }
.page-head form { margin: 0; }
.conn { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: #8a2f1c; text-decoration: none; }
.conn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.conn.is-on { color: var(--sage); }
/* Статусы: точка в календаре и плашка в списке/редакторе */
.dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #b9b1a3; }
.dot--review { background: #d39a2c; } .dot--scheduled { background: #4c8a4c; } .dot--published { background: #2f6f73; } .dot--failed { background: #c0442a; }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 700; background: var(--sand-2); color: var(--ink-2); white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.status--review { background: #fbecd0; color: var(--warn); }
.status--scheduled { background: var(--sage-soft); color: var(--sage); }
.status--published { background: #dfeeee; color: #2f6f73; }
.status--failed, .status--cancelled { background: #f3dcd6; color: #8a2f1c; }
.rubchip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--rub, var(--ink-2)); white-space: nowrap; }
.rubchip::before { content: ""; width: 10px; height: 3px; border-radius: 2px; background: var(--rub, #999); }
.flag { display: inline-block; font-style: normal; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--sand-2); color: var(--ink-2); }
.flag--todo { background: #fbecd0; color: var(--warn); }
.flag--bad { background: #f3dcd6; color: #8a2f1c; }
/* Фильтры и переключатель вида */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 20px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); font-size: 14px; text-decoration: none; }
.chip b { font-size: 13px; padding: 0 6px; border-radius: 10px; background: var(--sand-2); }
.chip:hover { border-color: var(--ink-2); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.is-active b { background: rgb(255 255 255 / 18%); }
.chip--todo b, .chip--lead-new b { background: #fbecd0; color: var(--warn); } .chip--failed b { background: #f3dcd6; color: #8a2f1c; }
.viewswitch { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--sand-2); margin: 0 0 12px; }
.viewswitch a { padding: 5px 14px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.viewswitch a.is-active { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / 8%); }
/* Календарь */
.cal__nav { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; }
.cal__nav b { font-size: 20px; text-transform: capitalize; min-width: 170px; text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal__head { font-size: 12px; color: var(--muted); font-weight: 700; padding: 0 6px; text-transform: uppercase; letter-spacing: .04em; }
.cal__cell { min-height: 118px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; gap: 5px; }
.cal__cell--empty { background: transparent; border-color: transparent; }
.cal__cell.is-weekend { background: #fcf9f3; }
.cal__cell.is-past { opacity: .6; }
.cal__cell.is-today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.cal__day { display: flex; align-items: baseline; gap: 6px; font-size: 13px; color: var(--muted); padding: 0 2px; }
.cal__day small { display: none; }
.cal__cell.is-today .cal__day b { background: var(--accent); color: #fff; border-radius: 10px; padding: 0 7px; }
.cal__post { display: grid; gap: 3px; padding: 6px 7px; border-radius: 8px; background: var(--bg); border-left: 3px solid var(--rub, #888); text-decoration: none; color: var(--ink); font-size: 12px; line-height: 1.3; transition: background .15s, box-shadow .15s; }
.cal__post:hover { background: #fff; box-shadow: 0 2px 8px rgb(0 0 0 / 8%); }
.cal__line { display: flex; align-items: center; gap: 5px; min-width: 0; }
.cal__line em { font-style: normal; color: var(--rub); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal__body { display: flex; gap: 6px; align-items: flex-start; }
.cal__thumb { flex: none; width: 34px; height: 34px; border-radius: 6px; object-fit: cover; background: var(--sand-2); }
.cal__body small { color: var(--ink-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.cal__post .flag { justify-self: start; }
.cal__slot { font-size: 12px; color: var(--muted); text-decoration: none; border: 1px dashed var(--line-strong); border-radius: 8px; padding: 4px 6px; opacity: 0; transition: opacity .15s; }
.cal__cell:hover .cal__slot, .cal__slot:focus { opacity: 1; }
.cal__slot:hover { color: var(--ink); border-color: var(--ink); }
@media (hover: none) { .cal__slot { opacity: .8; } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 12px 0 18px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend__sep { width: 1px; height: 14px; background: var(--line-strong); }
/* Список постов */
.plist { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.plist__item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--rub, var(--line)); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.plist__item:hover { border-color: var(--line-strong); box-shadow: 0 2px 10px rgb(0 0 0 / 6%); }
.thumb { flex: none; width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: var(--sand-2); }
.thumb--empty { background: linear-gradient(135deg, var(--sand-2), color-mix(in srgb, var(--rub, #999) 25%, var(--sand-2))); }
.plist__main { display: grid; gap: 4px; min-width: 0; }
.plist__top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.plist__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist__flags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.empty { display: grid; gap: 4px; justify-items: center; padding: 40px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); text-align: center; }
.empty b { color: var(--ink); font-size: 17px; }
@media (max-width: 900px) {
  .cal { grid-template-columns: 1fr; gap: 8px; }
  .cal__head, .cal__cell--empty { display: none; }
  /* Свободный день по сетке — тонкой строкой «+ 12:00 Рубрика»: видно, что день пуст и его можно занять одним касанием */
  .cal__cell.is-free { padding: 6px 8px; align-items: center; }
  .cal__cell.is-free:not(:has(.cal__slot)) { display: none; }
  .cal__cell.is-free .cal__day b { font-size: 15px; color: var(--muted); }
  .cal__cell.is-free .cal__slot { flex: 1; opacity: 1; padding: 8px 10px; }
  .cal__cell { min-height: 0; flex-direction: row; align-items: flex-start; padding: 8px; }
  .cal__cell.is-past { display: none; }
  .cal__day { flex-direction: column; align-items: center; gap: 0; min-width: 34px; }
  .cal__day b { font-size: 18px; color: var(--ink); }
  .cal__day small { display: block; font-size: 11px; }
  .cal__post { flex: 1; font-size: 13px; }
  .cal__cell > .cal__post + .cal__post { margin-left: 0; }
  .page-head { align-items: stretch; }
  .thumb { width: 52px; height: 52px; }
}
/* Редактор поста */
.crumbs { font-size: 14px; color: var(--muted); margin: 0 0 6px; }
.crumbs a { text-decoration: none; }
.crumbs span { margin: 0 4px; }
.post-head { margin: 0 0 14px; }
.post-head h1 { margin: 0 0 6px; }
.post-head__meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 14px; }
.channel-edit { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 20px; align-items: start; max-width: none; }
.channel-edit__main { display: grid; gap: 14px; min-width: 0; }
.channel-edit__side { position: sticky; top: 12px; display: grid; gap: 14px; }
.channel-edit textarea, .channel-edit input, .channel-edit select { max-width: 100%; box-sizing: border-box; }
.pane { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 16px 18px; min-width: 0; }
.pane h2 { margin: 0; font-size: 16px; }
.pane .hint { margin: 0; }
.pane__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pane__grid { display: grid; grid-template-columns: 1.3fr 1.3fr 1fr; gap: 10px; }
.pane__grid input, .pane__grid select { width: 100%; }
.counter { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.is-over { color: #c0442a; font-weight: 700; }
.fmt { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.fmt button { font: inherit; font-size: 13px; min-height: 30px; padding: 0 10px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--ink); cursor: pointer; }
.fmt button:hover { background: var(--paper); border-color: var(--line); }
.fmt mark { background: #fff1b8; padding: 0 2px; }
.fmt__todo { margin-left: auto; color: var(--warn) !important; }
.pane textarea[name=body] { min-height: 320px; font: 14px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.zhkinfo { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-radius: 10px; background: var(--bg); font-size: 14px; border: 1px solid var(--line); }
.zhkinfo.is-ok { background: var(--sage-soft); border-color: #c9d3c0; }
.zhkinfo.is-soft { background: #fbf3e0; border-color: #e8d3a3; }
.zhkinfo.is-bad { background: #fbece8; border-color: #e4b8ad; }
.zhkinfo__tools { display: flex; gap: 6px; flex-wrap: wrap; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.thumbs:empty { display: none; }
.thumbs__item { position: relative; display: block; cursor: grab; border-radius: 8px; transition: transform .12s, box-shadow .12s; }
.thumbs__item.is-dragging { opacity: .4; }
.thumbs__item.is-over { transform: scale(1.04); box-shadow: 0 0 0 2px var(--accent); }
.thumbs__item img { pointer-events: none; }
.thumbs img, .thumbs__bad { display: block; width: 96px; height: 72px; border-radius: 8px; object-fit: cover; background: var(--sand-2); }
.thumbs__item i { position: absolute; left: 4px; bottom: 4px; font-style: normal; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 5px; background: rgb(29 26 23 / 75%); color: #fff; }
.thumbs__del, .thumbs__first { position: absolute; top: 4px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgb(29 26 23 / 70%); color: #fff; font-size: 14px; line-height: 22px; cursor: pointer; padding: 0; }
.thumbs__del { right: 4px; } .thumbs__first { left: 4px; }
.thumbs__del:hover { background: #c0442a; } .thumbs__first:hover { background: var(--accent); }
.upload { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.pane.is-drop { outline: 2px dashed var(--accent); outline-offset: -6px; background: var(--accent-soft); }
.thumbs__bad { display: grid; place-items: center; font-size: 11px; color: #8a2f1c; background: #fbece8; }
.btnrows { display: grid; gap: 6px; }
.btnrow > * { min-width: 0; width: 100%; }
.btnrow > .btnrow__del { width: 34px; }
.btnrow { display: grid; grid-template-columns: 228px minmax(0, 1fr) minmax(0, 1.2fr) 86px 34px; gap: 6px; align-items: center; }
.btnrow[data-kind="catalog"] [data-btn-value], .btnrow[data-kind="lead"] [data-btn-value] { visibility: hidden; }
.btnrow__del { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--muted); font-size: 18px; cursor: pointer; }
.btnrow__del:hover { color: #8a2f1c; border-color: #e4b8ad; }
.btn--danger-ghost { background: transparent; border-color: transparent; color: #8a2f1c; }
.btn--danger-ghost:hover { background: #fbece8; border-color: #e4b8ad; }
.actionbar { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 14px; margin: 0 -2px; background: rgb(255 253 249 / 94%); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 -4px 16px rgb(0 0 0 / 6%); }
.actionbar__spacer { flex: 1; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 0 0 18px; }
.week__day { display: grid; align-content: start; gap: 5px; padding: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; font-size: 13px; }
.week__day > b { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.week__slot { display: grid; padding: 4px 7px; border-radius: 7px; background: var(--bg); border-left: 3px solid var(--rub); font-weight: 600; color: var(--rub); line-height: 1.25; }
.week__slot small { color: var(--muted); font-weight: 400; }
@media (max-width: 760px) { .week { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Колонка справа: пост как в телефоне и готовность */
.phone { background: #eef1f5; border-radius: 22px; padding: 10px; border: 1px solid #dde2ea; }
.phone__bar { display: flex; align-items: center; gap: 8px; padding: 2px 6px 10px; font-size: 14px; }
.phone__bar small { color: #7a8494; }
.phone__ava { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--gold); font-weight: 800; font-size: 13px; }
.ready-card { margin: 0; padding: 14px 16px; }
.ready-card h2 { font-size: 15px; margin: 0 0 8px; }
.ready { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.ready li { display: flex; gap: 8px; align-items: flex-start; }
.ready li::before { flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; margin-top: 1px; }
.ready li.is-ok::before { content: "✓"; background: var(--sage-soft); color: var(--sage); }
.ready li.is-bad::before { content: "!"; background: #f3dcd6; color: #8a2f1c; }
.ready li.is-soft::before { content: "·"; background: #fbecd0; color: var(--warn); }
.ready li.is-bad { color: #8a2f1c; }
@media (max-width: 1100px) {
  .channel-edit { grid-template-columns: minmax(0, 1fr); }
  .channel-edit__side { position: static; }
  .phone { max-width: 420px; }
}
@media (max-width: 700px) {
  .pane__grid { grid-template-columns: 1fr; }
  .btnrow { grid-template-columns: 1fr 1fr 34px; }
  .btnrow [name=btn_text] { grid-column: 1 / 3; grid-row: 2; }
  .btnrow [data-btn-value] { grid-column: 1 / 3; grid-row: 3; }
  .btnrow [name=btn_row] { grid-column: 2; grid-row: 1; }
  .btnrow__del { grid-column: 3; grid-row: 1; }
  .btnrow[data-kind="catalog"] [data-btn-value], .btnrow[data-kind="lead"] [data-btn-value] { display: none; }
  .pane { padding: 14px; }
  .actionbar { position: static; box-shadow: none; }
  .actionbar .btn { flex: 1 1 auto; justify-content: center; }
  .actionbar__spacer { display: none; }
}
/* Предпросмотр: примерно как пост в канале MAX */
.maxpost { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; max-width: 380px; box-shadow: 0 2px 10px rgb(0 0 0 / 6%); }
.maxpost__album { display: grid; gap: 2px; grid-template-columns: 1fr 1fr; }
.maxpost__album[data-count="0"] { display: none; }
.maxpost__album img { display: block; width: 100%; height: 130px; object-fit: cover; }
.maxpost__album[data-count="1"] img { grid-column: 1 / -1; height: 240px; }
.maxpost__album[data-count="3"] img:first-child { grid-column: 1 / -1; height: 190px; }
.maxpost__text h1, .maxpost__text h2, .maxpost__text h3, .maxpost__text h4 { margin: 0 0 4px; font-size: 18px; line-height: 1.3; }
.maxpost__text blockquote { margin: 6px 0; padding: 4px 10px; border-left: 3px solid #2a6fdb; background: #f3f6fb; border-radius: 0 8px 8px 0; }
.maxpost__text mark { background: #fff1b8; padding: 0 2px; border-radius: 3px; }
.maxpost__text { padding: 12px 14px; font-size: 15px; line-height: 1.45; word-wrap: break-word; }
.maxpost__text a { color: #2a6fdb; }
.maxpost__buttons { display: grid; gap: 4px; padding: 0 8px 8px; }
.maxpost__row { display: flex; gap: 4px; }
.maxpost__row span { flex: 1; text-align: center; padding: 9px 8px; border-radius: 10px; background: #eef2f8; color: #2a6fdb; font-weight: 600; font-size: 14px; }

/* Раздел «Бот» → «Диалоги на сайте»: реплики посетителя справа, ассистента слева */
.chat-line { margin-block: 0; }
.chat-line--user { margin-left: 15%; background: var(--bg, #f6f1e8); }
.chat-line--bot { margin-right: 15%; }
.chat-line__who { margin: 0 0 4px; }
.chat-line__text { margin: 0; white-space: pre-line; }
.chat-line__meta { margin: 6px 0 0; }
@media (max-width: 640px) { .chat-line--user { margin-left: 8%; } .chat-line--bot { margin-right: 8%; } }

/* Справка (/help): поиск, разделы кнопками, раскрывающиеся инструкции */
.help { max-width: 760px; }
.help__sub { margin: -8px 0 14px; }
.help__search { width: 100%; min-height: 46px; border-radius: 12px; margin-bottom: 12px; }
.help__chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 4px; scrollbar-width: none; }
.help__chip { white-space: nowrap; font: inherit; font-size: 14px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); cursor: pointer; }
.help__chip.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.help__grp { font-size: 13px; color: var(--muted); margin: 18px 4px 8px; }
.help__item { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; scroll-margin-top: 16px; }
.help__item:target, .help__item.is-hit { border-color: var(--accent); }
.help__item summary { display: flex; align-items: center; gap: 12px; padding: 13px 14px; cursor: pointer; list-style: none; }
.help__item summary::-webkit-details-marker { display: none; }
.help__icon { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); display: grid; place-items: center; font-size: 18px; flex: none; }
.help__title { flex: 1; min-width: 0; }
.help__title b { display: block; }
.help__title small { color: var(--muted); font-size: 13px; }
.help__chev { color: var(--muted); transition: transform .15s; }
.help__item[open] .help__chev { transform: rotate(180deg); }
.help__body { padding: 0 14px 14px 62px; font-size: 14px; line-height: 1.6; }
.help__body ol { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.help__lbl { font-size: 12px; color: var(--muted); margin: 12px 0 2px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.help__lbl:first-child { margin-top: 0; }
.help__warn { background: #fff4dc; color: var(--warn); border-radius: 10px; padding: 9px 11px; margin: 12px 0 0; }
.help__warn a, .help__body a { color: var(--accent-ink); }
.help-q { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 4px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 700; text-decoration: none; vertical-align: 1px; }
.help-q:hover { background: var(--accent); color: #fff; }
@media (max-width: 600px) { .help__body { padding-left: 14px; } }

/* Поле формы — элемент сетки: без min-width: 0 он не ужимается уже своего содержимого */
.field, .form-grid > * { min-width: 0; }
.field > select, .field > input:not([type=checkbox]):not([type=radio]), .field > textarea { width: 100%; }
select { text-overflow: ellipsis; }

.narrow-only { display: none; }
/* Канал на телефоне: шапка раздела, фильтры и календарь — компактно, чтобы посты были видны без прокрутки */
@media (max-width: 760px) {
  .wide-only { display: none; }
  .narrow-only { display: inline; }
  .page-head { gap: 10px; margin-bottom: 10px; }
  .ch-actions { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 6px; width: 100%; }
  .ch-actions > *, .ch-actions form .btn { width: 100%; justify-content: center; }
  .ch-actions .btn { padding: 0 10px; min-height: 42px; }
  /* Фильтры — одной строкой с прокруткой вбок, край растворяется: видно, что дальше есть ещё */
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px 10px; padding: 0 40px 2px 12px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; white-space: nowrap; min-height: 36px; }
  .viewswitch { display: flex; width: 100%; margin-bottom: 8px; }
  .viewswitch a { flex: 1; text-align: center; padding: 8px 10px; }
  .cal__nav { justify-content: space-between; gap: 6px; margin: 0 0 8px; }
  .cal__nav b { flex: 1; min-width: 0; font-size: 18px; }
  .cal__nav .btn { min-width: 44px; justify-content: center; }
  .legend { gap: 6px 10px; }
  .plist__item { padding: 10px; gap: 10px; }
  .plist__title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .hint { font-size: 13px; }
}
/* Сетка рубрик на телефоне: слот — две строки (день и время, рубрика и «вкл.»), а не четыре карточные строки с подписями */
@media (max-width: 760px) {
  table.responsive.slots-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; }
  table.responsive.slots-table td { display: block; padding: 0; }
  table.responsive.slots-table td::before { content: none; }
  table.responsive.slots-table select, table.responsive.slots-table input { width: 100%; }
  .week { gap: 4px; }
  .week__day { padding: 6px; }
}

/* Закреп поста — переключатель на всю ширину строки полей, в рамке */
.pin-switch { grid-column: 1 / -1; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper, #fff); }
.pin-switch:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--paper, #fff)); }

/* Канал → Каналы и боты */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px 16px; align-items: end; }
.grid-3 > * { min-width: 0; }
.chset { max-width: 980px; }
.chset__head { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.chset__head .grow { flex: 1 1 280px; }
.chset-new { max-width: 980px; margin-top: 14px; }
.chset-new > summary { cursor: pointer; padding: 4px 0; }
.chset-new[open] > summary { margin-bottom: 12px; }
.chset-new .chset { box-shadow: none; padding: 0; border: 0; }
.muted.small, p.small { font-size: 13px; }

/* Массовые действия в таблице заявок: колонка с галочкой, панель «Выбрано: N», выделенная строка */
.col-check { width: 36px; padding-right: 0 !important; }
.col-check input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.bulkbar { display: flex; align-items: center; gap: 14px; position: sticky; top: 8px; z-index: 5; margin: 0 0 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: 0 2px 10px rgb(29 26 23 / 8%); }
.bulkbar[hidden] { display: none; }
tr.is-picked { background: var(--accent-soft); }
details.danger-zone { margin-top: 18px; }
details.danger-zone summary { cursor: pointer; font-weight: 700; color: #8a2f1c; }
details.danger-zone form { margin-top: 12px; max-width: 520px; }

/* ═══ Единая сетка и выравнивание (13.10.2026) ═══════════════════════════════════════════════════════════════════
   Слой поверх прежних правил: шапка в один ряд, заголовки страниц с кнопками справа, ровные чекбоксы, раскрывающиеся
   блоки без «сырого» вида браузера, карточки одной высоты, аккуратные таблицы. */

/* Шапка: одним рядом; не помещается — прокрутка вбок, а не второй этаж */
@media (min-width: 1101px) {
  .top { flex-wrap: nowrap; gap: 14px; padding: 8px 18px; }
  .brand { flex: none; }
  .nav-wide { flex-wrap: nowrap; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .nav-wide::-webkit-scrollbar { display: none; }
  .top nav a { flex: none; padding: 6px 8px; font-size: 14.5px; }
  .me { flex: none; white-space: nowrap; }
}
@media (min-width: 1101px) and (max-width: 1360px) { .brand span { display: none; } }

/* Заголовок страницы: название слева, действия справа в один ряд по центру */
.page-head { align-items: center; justify-content: flex-start; margin: 0 0 16px; }
.page-head > h1, .page-head > div:first-child { margin: 0 auto 0 0; }
.page-head > div:first-child h1 { margin: 0; }
.page-head p { margin: 4px 0 0; }

/* Флажки и переключатели: общий стиль полей давал им высоту 40 px и сдвигал вниз */
input[type=checkbox], input[type=radio] { min-height: 0; width: 18px; height: 18px; padding: 0; accent-color: var(--accent); vertical-align: middle; flex: none; }
th input[type=checkbox], td input[type=checkbox] { display: block; margin: 0; }

/* Раскрывающиеся блоки: единый вид вместо браузерной стрелки с синей рамкой */
details:not(.help__item):not(.menu) > summary { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; margin: 0 0 0 -10px; border-radius: 8px; font-weight: 600; color: var(--accent-ink); cursor: pointer; list-style: none; user-select: none; }
details:not(.help__item):not(.menu) > summary::-webkit-details-marker { display: none; }
details:not(.help__item):not(.menu) > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-right: 2px; }
details[open]:not(.help__item):not(.menu) > summary::before { transform: rotate(45deg); }
details:not(.help__item):not(.menu) > summary:hover { background: var(--accent-soft); }
details:not(.help__item):not(.menu) > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
details.card > summary { margin-left: 0; }
details > summary + * { margin-top: 10px; }

/* Карточки в сетке — одной высоты, без лишнего нижнего отступа */
.grid2 { align-items: stretch; }
.grid2 { margin-bottom: 16px; }
.grid2 > .card { margin: 0; }
.grid2--account { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid2--account { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); } }
.status-line { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 12px; }
.status-line .badge { flex: none; margin-top: 3px; }

/* Таблицы: содержимое по центру строки, даты и времена не переносятся */
td { vertical-align: middle; }
.audit td, .publish-log td { vertical-align: top; }
.nowrap { white-space: nowrap; }
.table-scroll { overflow-x: auto; margin: 0 0 12px; border-radius: var(--radius); }
.table-scroll table { margin: 0; }

/* Пользователи: карточка на человека — имя, сведения, роль, действия; правка раскрывается на всю ширину */
.people { display: grid; gap: 10px; margin: 0 0 20px; }
.person { display: grid; grid-template-columns: minmax(180px, 1fr) 240px 390px 235px; align-items: center; gap: 10px 22px; padding: 14px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.person.is-off { opacity: .6; }
.person__who { display: grid; gap: 1px; min-width: 0; }
.person__who .muted { overflow-wrap: anywhere; font-size: 14px; }
.person__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; }
.person__role, .person__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.person__role select { min-height: 34px; padding: 4px 8px; }
.person__edit { grid-column: 1 / -1; border-top: 1px dashed var(--line); padding-top: 6px; margin-top: 2px; }
.person__edit[open] { padding-bottom: 4px; }
.person__form { max-width: 880px; margin-top: 8px; }
.person__form-gap { display: none; }
.newuser { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(200px, 1.3fr) minmax(150px, .8fr) auto; gap: 10px; align-items: end; max-width: 860px; }
.newuser .btn { min-height: 40px; }
@media (max-width: 1100px) { .person { grid-template-columns: 1fr 1fr; } .person__who { grid-column: 1 / -1; } .newuser { grid-template-columns: 1fr 1fr; } .newuser .btn { grid-column: 1 / -1; } }
@media (max-width: 640px) { .person { grid-template-columns: 1fr; } .newuser { grid-template-columns: 1fr; } }

/* Форма-сетка: поля в ряд выровнены по верху, широкие — на всю строку */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 14px 18px; align-items: start; }
.form-grid > .field--wide, .form-grid > div.field--wide { grid-column: 1 / -1; }

/* Журнал действий: дни отдельными строками, раздел цветной меткой, детали читаемым списком */
.audit .day-row td { background: var(--sand-2); padding: 7px 14px; font-size: 13px; font-weight: 700; color: var(--ink-2); letter-spacing: .01em; }
.audit tbody tr.day-row:hover td { background: var(--sand-2); }
.tag { display: inline-block; padding: 1px 8px; margin-right: 6px; border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--sand-2); color: var(--ink-2); vertical-align: 1px; }
.tag--auth { background: #e6edf7; color: #2d4a7a; } .tag--leads { background: #fbecd0; color: #8a5a00; } .tag--catalog { background: #e9ede3; color: #57634a; }
.tag--content { background: #efe6f3; color: #6a3f7c; } .tag--channel { background: #e3f2fb; color: #1c6da0; } .tag--settings { background: #f3dcd6; color: #8a2f1c; }
.tag--people { background: #fff0c7; color: #7a5a00; } .tag--publish { background: #dff0e3; color: #2f6b3a; }
.audit-more > summary { font-size: 13px; padding: 0 8px; line-height: 1.4; }
.diff { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px 14px; margin: 8px 0 0; font-size: 13px; }
.diff dt { color: var(--muted); } .diff dd { margin: 0; overflow-wrap: anywhere; }
.small { font-size: 13px; }

/* История публикаций: журнал сборки свёрнут в одну строку, развёрнутый — в прокручиваемом окне */
.logbox > summary { max-width: 100%; display: flex; font-weight: 500; color: var(--ink-2); }
.logbox > summary::before { flex: none; }
.logbox pre { margin: 8px 0 0; max-height: 320px; overflow: auto; padding: 12px 14px; border-radius: 10px; background: var(--ink); color: #e8e1d2; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Бот → по дням: три числа в ячейке, цветом платформы; нули приглушены */
.byday .legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 6px 0 10px; font-size: 13px; color: var(--muted); }
.byday__table th, .byday__table td { padding: 8px 6px; white-space: nowrap; }
.byday__table th:first-child, .byday__table td:first-child { padding-left: 12px; }
.byday__table th { white-space: normal; min-width: 0; font-size: 11px; line-height: 1.25; vertical-align: bottom; }
.n { display: inline-block; min-width: 24px; padding: 1px 5px; margin-right: 2px; border-radius: 6px; text-align: center; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.n--max { background: #e7ecfb; color: #2d3f8f; } .n--tg { background: #e1f1fb; color: #1c6da0; } .n--web { background: var(--accent-soft); color: var(--accent-ink); }
.n.is-zero { background: transparent; color: #b9b2a4; font-weight: 400; }
.legend .n { font-size: 12px; }

/* Логотип и иконки: встроенная картинка видна сразу; выбор файла в общем стиле */
.brand-preview { height: 160px; min-height: 0; overflow: hidden; }
.brand-preview img { max-height: 100%; max-width: 100%; object-fit: contain; }
.brand-preview--logo img, .brand-preview--favicon img { max-height: 96px; }
.brand-preview--og img { width: 100%; height: 100%; border-radius: 6px; }
.brand-state { margin: 0 0 12px; }
input[type=file] { width: 100%; padding: 6px; background: var(--paper); border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--muted); }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; margin-right: 10px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); cursor: pointer; }
input[type=file]::file-selector-button:hover { border-color: var(--ink); }
.brand-preview + form, .brand-state + form { margin-bottom: 8px; }

/* Услуги: группы на всю ширину, шапка группы — одна выровненная строка */
.group { padding: 18px 20px; }
.group__head { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(240px, 2fr) 110px auto; gap: 12px 16px; align-items: end; margin: 0 0 16px; }
.group__head--new { grid-template-columns: minmax(180px, 1fr) minmax(240px, 2fr) auto; margin: 6px 0 0; }
.group__actions { display: flex; gap: 8px; align-items: center; }
.group table { table-layout: fixed; }
.group th:nth-child(2), .group th:nth-child(3) { width: 150px; } .group th:nth-child(4) { width: 110px; } .group th:nth-child(5) { width: 160px; }
.group table td:nth-child(n+2) { white-space: nowrap; }
details.group > summary { margin-left: -10px; }
@media (max-width: 900px) { .group__head, .group__head--new { grid-template-columns: 1fr 1fr; } .group__head .field:nth-child(2) { grid-column: 1 / -1; } .group__actions { grid-column: 1 / -1; } }
@media (max-width: 560px) { .group__head, .group__head--new { grid-template-columns: 1fr; } }

/* Настройки: ссылки на разделы длинной страницы закреплены вверху */
.chips--jump { position: sticky; top: 0; z-index: 6; margin: 0 0 12px; padding: 8px 0; background: var(--bg); box-shadow: 0 8px 10px -8px rgb(29 26 23 / 18%); }
.section { scroll-margin-top: 64px; }

/* Журнал на телефоне: запись — компактная карточка из трёх строк (время и кто · действие · объект и детали), без подписей полей */
@media (max-width: 760px) {
  table.audit tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 10px 14px; margin: 0 0 8px; }
  table.audit td { display: block; width: auto; padding: 0; border: 0; grid-template-columns: none; }
  table.audit td::before { content: none; }
  table.audit td[data-label="Время"] { order: 1; color: var(--muted); font-size: 13px; }
  table.audit td[data-label="Кто"] { order: 2; color: var(--muted); font-size: 13px; }
  table.audit td[data-label="Действие"] { order: 3; flex: 1 1 100%; font-weight: 600; margin-top: 2px; }
  table.audit td[data-label="Объект"] { order: 4; font-size: 14px; }
  table.audit td[data-label="Детали"] { order: 5; font-size: 14px; margin-left: auto; }
  table.audit tr.day-row { display: block; padding: 0; margin: 14px 0 6px; background: none; border: 0; }
  table.audit tr.day-row td { background: none; padding: 0 2px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); width: 100%; }
  table.audit .audit-more { width: 100%; }
  .person__role select { flex: 1 1 120px; }
}

/* Канал: фильтры постов и переключатель «Календарь / Список» — одной строкой */
.chanbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 14px; }
.chanbar .chips { margin: 0 auto 0 0; }
.chanbar .viewswitch { margin: 0; }

/* Заявки: сортировка по заголовкам, баннер корзины, диалог клиента */
.sortlink { color: inherit; text-decoration: none; white-space: nowrap; }
.sortlink:hover { color: var(--accent-ink); }
.sortlink i { font-style: normal; margin-left: 4px; color: var(--accent-ink); }
th .sortlink.is-on { color: var(--ink); }
.trashbanner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.trashbanner form { margin: 0; }
.chatlog { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-width: 760px; }
.chatlog li { display: grid; gap: 2px; padding: 8px 12px; border-radius: 10px; background: var(--bg); }
.chatlog__user { background: var(--accent-soft); }
.chatlog__who { font-size: 12px; color: var(--muted); }

/* Сводка: быстрые действия у заявки, подзаголовки блоков */
.dash-sub { margin: 14px 0 8px; font-size: 14px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.plist__row { display: flex; align-items: stretch; gap: 8px; }
.plist__row > .plist__item { flex: 1; min-width: 0; }
.plist__actions { display: flex; align-items: center; gap: 6px; flex: none; }
.plist__actions form { margin: 0; }
@media (max-width: 760px) { .plist__row { flex-wrap: wrap; } .plist__actions { width: 100%; } .plist__actions .btn { flex: 1; justify-content: center; } }

/* Состояние системы: светофор */
.lamp { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 50%; background: #b9b2a4; box-shadow: 0 0 0 3px rgb(185 178 164 / 25%); }
.lamp--ok { background: #3f9b5b; box-shadow: 0 0 0 3px rgb(63 155 91 / 22%); }
.lamp--warn { background: #d99a1f; box-shadow: 0 0 0 3px rgb(217 154 31 / 25%); }
.lamp--fail { background: #c0432b; box-shadow: 0 0 0 3px rgb(192 67 43 / 25%); }
.statusbar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; margin: 0 0 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--paper); font-size: 16px; }
.statusbar--ok { border-color: #c9d3c0; background: var(--sage-soft); } .statusbar--warn { border-color: #e8d3a3; background: #fbf3e0; } .statusbar--fail { border-color: #e4b8ad; background: #fbece8; }
.checks { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; max-width: 920px; }
.check-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.check-row--warn { border-left: 4px solid #d99a1f; } .check-row--fail { border-left: 4px solid #c0432b; }
.check-row__main { display: grid; gap: 1px; flex: 1; min-width: 0; }
.check-row__main span { color: var(--ink-2); font-size: 14px; }
.check-row__state { font-size: 13px; color: var(--muted); white-space: nowrap; }
.healthstrip { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; margin: 0 0 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink); text-decoration: none; }
.healthstrip:hover { border-color: var(--line-strong); }
.healthstrip--warn { border-color: #e8d3a3; background: #fbf3e0; } .healthstrip--fail { border-color: #e4b8ad; background: #fbece8; }
.healthstrip .muted { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.healthstrip__go { color: var(--accent-ink); font-size: 14px; font-weight: 600; }

/* Публикация: что изменится и живой ход */
.preview-changes { margin: 0 0 14px; padding: 12px 14px; background: var(--bg); border-radius: 10px; }
.preview-changes h3 { margin: 0 0 8px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.preview-changes__group { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 6px 12px; align-items: start; padding: 6px 0; border-top: 1px solid var(--line); }
.preview-changes__group:first-of-type { border-top: 0; }
.preview-changes__items { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.preview-changes .chip { font-size: 13px; padding: 3px 10px; }
@media (max-width: 760px) { .preview-changes__group { grid-template-columns: 1fr; } }
.live { border-color: #e8d3a3; background: #fbf6e8; }
.live__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.live__line { margin: 8px 0; min-height: 1.4em; overflow-wrap: anywhere; }
.live__bar { height: 4px; border-radius: 2px; background: #eadfc4; overflow: hidden; margin: 0 0 8px; }
.live__bar i { display: block; width: 35%; height: 100%; background: var(--accent); border-radius: 2px; animation: livebar 1.6s ease-in-out infinite; }
@keyframes livebar { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #eadfc4; border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .live__bar i, .spinner { animation: none; } }

/* История правок */
.settings-history { margin: -4px 0 12px; font-size: 14px; }
.revs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-width: 920px; }
.rev { padding: 12px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.rev__head { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.rev__head form { margin: 0 0 0 auto; }
.rev__sum { font-size: 14px; color: var(--ink-2); }
.rev__diff { margin-top: 6px; }
.diff--wide { grid-template-columns: minmax(120px, 200px) minmax(0, 1fr); }
.diff__was { text-decoration: line-through; color: #8a2f1c; }
.diff__now { color: var(--sage); font-weight: 600; }

/* Меню: выпадающие группы (Каталог, Контент, Система) */
.top nav.nav-wide { overflow: visible; }
.navgroup { position: relative; }
.top nav.nav-wide .navgroup > summary { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; margin: 0; border-radius: 8px; color: #fff; opacity: .85; font-weight: 400; font-size: 14.5px; cursor: pointer; list-style: none; user-select: none; white-space: nowrap; }
.top nav.nav-wide .navgroup > summary::-webkit-details-marker { display: none; }
.top nav.nav-wide .navgroup > summary::before { content: none; }
.top nav.nav-wide .navgroup > summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); opacity: .7; }
.top nav.nav-wide .navgroup > summary:hover, .navgroup[open] > summary, .navgroup.is-active > summary { background: rgb(183 150 95 / 22%); opacity: 1; }
.top nav.nav-wide .navgroup > summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.navgroup__panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; min-width: 180px; display: grid; gap: 2px; padding: 6px; background: var(--ink); border: 1px solid rgb(255 255 255 / 14%); border-radius: 12px; box-shadow: 0 14px 30px rgb(0 0 0 / 35%); }
.top .navgroup__panel a { padding: 8px 12px; border-radius: 8px; font-size: 14.5px; opacity: .92; }
@media (min-width: 1101px) { .top nav.nav-wide a { padding: 6px 10px; } .top nav.nav-wide { gap: 4px; } }

/* Заметки «Взгляд Юлии» */
.toolbar__links { display: inline-flex; gap: 14px; margin-left: auto; font-size: 14px; }
.toolbar__links a { color: var(--ink-2); text-decoration: none; padding: 4px 2px; border-bottom: 2px solid transparent; }
.toolbar__links a.is-on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 700; }
.guide { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); max-width: 820px; }
.note-form { max-width: 920px; }
tr.is-off td { opacity: .6; }

/* Сессии и права по ролям */
.grid-span { grid-column: 1 / -1; }
.sessions { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.sessions li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.sessions li.is-current { border-color: #c9d3c0; background: var(--sage-soft); }
.sessions__what { display: grid; gap: 2px; flex: 1; min-width: 0; }
.sessions form { margin: 0; }
.matrix th, .matrix td { padding: 8px 12px; }
.matrix th:not(:first-child), .matrix__cell { text-align: center; width: 120px; }
.matrix .yes { font-style: normal; color: var(--sage); font-size: 18px; line-height: 1; }
.matrix .no { font-style: normal; color: #c9c0ae; }
.matrix__sub td { background: var(--sand-2); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 12px; }

/* Единый поиск (⌘K) */
.searchbtn { display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 34px; padding: 0 10px; border: 1px solid rgb(255 255 255 / 22%); border-radius: 10px; background: rgb(255 255 255 / 6%); color: #fff; font: inherit; font-size: 14px; cursor: pointer; opacity: .9; }
.searchbtn:hover { background: rgb(255 255 255 / 14%); opacity: 1; }
.searchbtn kbd { font: inherit; font-size: 12px; padding: 1px 6px; border-radius: 6px; background: rgb(255 255 255 / 16%); }
@media (max-width: 1100px) { .searchbtn span, .searchbtn kbd { display: none; } .searchbtn { padding: 0 9px; margin-left: auto; } }
.searchbox { width: min(680px, calc(100vw - 24px)); max-height: min(80vh, 640px); padding: 0; border: 0; border-radius: 16px; background: var(--paper); color: var(--ink); box-shadow: 0 24px 60px rgb(29 26 23 / 45%); overflow: hidden; margin-top: 10vh; }
.searchbox[open] { display: flex; flex-direction: column; }
.searchbox::backdrop { background: rgb(29 26 23 / 50%); backdrop-filter: blur(3px); }
.searchbox__form { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.searchbox__form input { flex: 1; min-height: 44px; font-size: 17px; border: 0; padding: 0 4px; background: none; }
.searchbox__form input:focus { outline: none; }
.searchbox__close { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 3px 9px; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; }
.searchbox__results { overflow-y: auto; padding: 8px 10px 12px; }
.searchbox__results > p { margin: 10px 6px; font-size: 14px; }
.searchbox__group h3 { margin: 12px 6px 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.searchbox__item { display: grid; gap: 1px; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.searchbox__item small { color: var(--muted); font-size: 13px; }
.searchbox__item:hover, .searchbox__item.is-active { background: var(--accent-soft); }

/* Настройки: сворачиваемые разделы со статусом заполнения */
details.section--fold { padding: 0; }
details.section--fold > summary.section__title { display: flex; align-items: center; justify-content: flex-start; gap: 12px; margin: 0; padding: 16px 0; margin-left: 0; font-size: 16px; font-weight: 800; color: var(--ink); border-radius: 0; }
details.section--fold > summary.section__title:hover { background: none; color: var(--accent-ink); }
details.section--fold > summary + * { margin-top: 0; }
.section__body { padding: 0 0 22px; }
.chips__tools { margin-left: auto; display: inline-flex; gap: 12px; align-items: center; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--accent-ink); cursor: pointer; text-decoration: underline; }

/* Выбор значка плитками (статьи и услуги): радиокнопка скрыта, выбранный значок — в рамке */
fieldset.icon-picker { margin: 0; padding: 0; border: 0; min-width: 0; }
.icon-picker legend { padding: 0; margin-bottom: 8px; font-weight: 600; }
.icon-picker__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.icon-picker__item { display: block; position: relative; cursor: pointer; font-weight: 400; }
.icon-picker__item input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; margin: 0; opacity: 0; cursor: pointer; }
.icon-picker__tile { display: grid; justify-items: center; align-content: start; gap: 2px; height: 100%; padding: 10px 6px 9px; text-align: center; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink-2); transition: border-color .12s, background-color .12s; }
.icon-picker__tile svg { margin-bottom: 4px; color: var(--accent-ink); }
.icon-picker__tile b { font-size: 13px; font-weight: 700; color: var(--ink); }
.icon-picker__tile small { font-size: 11px; line-height: 1.25; color: var(--muted); }
.icon-picker__item:hover .icon-picker__tile { border-color: var(--line-strong); background: var(--bg); }
.icon-picker__item input:checked + .icon-picker__tile { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.icon-picker__item input:focus-visible + .icon-picker__tile { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 520px) { .icon-picker__grid { grid-template-columns: repeat(3, 1fr); } }
