/* Макет публичной части справочного центра (в стиле кабинета Разбиратора) */
:root {
  --ink: #2b2622; --muted: #7a7068; --line: #ece5dc; --bg: #ffffff; --side: #f7f4ef;
  --accent: #36b6cb; --accent-ink: #157d8e; --accent-soft: #e4f6f9; --yellow: #e8c34a;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 15px; }
a { color: var(--accent-ink); }
.muted { color: var(--muted); }
mark { background: #fff1b8; color: inherit; border-radius: 2px; padding: 0 1px; }

/* Шапка */
.topbar {
  position: sticky; top: 0; z-index: 30; height: 64px; display: flex; align-items: center; gap: 18px;
  padding: 0 24px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px);
}
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; white-space: nowrap; }
.logo img { height: 22px; width: auto; display: block; }
.logo small { font-size: 13px; font-weight: 500; color: var(--accent-ink); letter-spacing: 0; }
.topbar .search { flex: 1; max-width: 480px; margin-left: auto; }
.topbar .search input { width: 100%; height: 40px; border: 1px solid var(--line); background: var(--side); border-radius: 10px; padding: 0 14px 0 38px; font: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%237a7068' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 4 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 13px center; }
.topbar .search input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); background-color: #fff; }
.admin-link { font-weight: 600; text-decoration: none; padding: 8px 14px; border-radius: 9px; background: var(--accent-soft); white-space: nowrap; }
.menu-btn { display: none; width: 40px; height: 40px; border: 0; background: transparent; padding: 10px 9px; cursor: pointer; }
.menu-btn span { display: block; height: 2px; background: var(--ink); margin: 4px 0; border-radius: 2px; }

/* Сетка */
.layout { display: flex; min-height: calc(100vh - 64px); }
.sidebar { width: 290px; flex: none; background: var(--side); border-right: 1px solid var(--line); padding: 22px 14px 40px;
  position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; }
.nav-section { margin-bottom: 22px; }
.nav-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 10px 8px; }
.nav-title .ico { margin-right: 6px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; line-height: 1.35; font-size: 14.5px; }
.sidebar li a:hover { background: #efe9e1; }
.sidebar li a.active { background: #fff; color: var(--accent-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.sidebar .draft { opacity: .55; }
.sidebar a.draft::after { content: " · черновик"; font-size: 12px; }
.nav-backdrop { display: none; }
.main { flex: 1; min-width: 0; padding: 34px 48px 0; display: flex; flex-direction: column; }

/* Статья */
.article-wrap { display: flex; gap: 40px; align-items: flex-start; }
.article { flex: 1; min-width: 0; max-width: 820px; }
.article h1 { font-size: 32px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; margin: 6px 0 18px; }
.crumbs { font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs span { margin: 0 4px; opacity: .6; }
.crumbs a:hover { color: var(--accent-ink); }
.draft-badge.small { font-size: 11.5px; padding: 1px 7px; margin: 0 0 0 6px; vertical-align: 2px; }
a.nav-title { display: block; text-decoration: none; }
a.nav-title:hover { color: var(--accent-ink); }

/* Страница раздела */
.section-page .lead { font-size: 17px; color: var(--muted); line-height: 1.55; margin: 0 0 26px; max-width: 680px; }
.section-list { list-style: none; counter-reset: n; padding: 0; margin: 0; max-width: 680px; border-top: 1px solid var(--line); }
.section-list li { counter-increment: n; border-bottom: 1px solid var(--line); }
.section-list li a { display: flex; gap: 14px; align-items: baseline; padding: 14px 4px; font-size: 16.5px; font-weight: 500; color: var(--ink); text-decoration: none; }
.section-list li a::before { content: counter(n); min-width: 22px; font-size: 13px; font-weight: 700; color: var(--accent-ink); }
.section-list li a:hover { color: var(--accent-ink); }
.draft-badge { display: inline-block; background: #fff4d6; color: #8a6400; border-radius: 6px; padding: 4px 10px; font-size: 13px; margin-bottom: 16px; }
.meta { margin-top: 34px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin: 22px 0 10px; }
.pager a { flex: 1; max-width: 48%; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; text-decoration: none; color: var(--ink); font-weight: 600; line-height: 1.35; }
.pager a:hover { border-color: var(--accent); }
.pager a small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.pager .next { text-align: right; margin-left: auto; }
.toc { width: 220px; flex: none; position: sticky; top: 92px; font-size: 13.5px; }
.toc-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc li a { display: block; padding: 4px 0 4px 12px; color: var(--muted); text-decoration: none; line-height: 1.35; margin-left: -2px; border-left: 2px solid transparent; }
.toc li a:hover, .toc li a.on { color: var(--accent-ink); border-left-color: var(--accent); }

/* Главная */
.home { max-width: 1060px; }
.hero { padding: 18px 0 28px; }
.hero h1 { font-size: 36px; margin: 0 0 8px; letter-spacing: -.01em; }
.hero p { color: var(--muted); font-size: 17px; margin: 0 0 20px; }
.search.big { display: flex; gap: 10px; max-width: 640px; margin-bottom: 18px; }
.search.big input { flex: 1; height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; font: inherit; font-size: 16px; background: var(--side); }
.search.big input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); background: #fff; }
.btn { height: 48px; padding: 0 22px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font: inherit; font-weight: 600; cursor: pointer; color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.card { border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; background: #fff; }
.card h2 { font-size: 19px; margin: 0 0 6px; }
.card h2 .ico { margin-right: 8px; }
.card h2 a { color: inherit; text-decoration: none; }
.card h2 a:hover { color: var(--accent-ink); }
.card p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; }
.card ul { margin: 0; padding: 0; list-style: none; }
.card li { padding: 5px 0; border-top: 1px dashed var(--line); }
.card li:first-child { border-top: 0; }
.card li a { text-decoration: none; }
.card li a:hover { text-decoration: underline; }

/* Поиск */
.results { list-style: none; padding: 0; margin: 10px 0 0; }
.results li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.results li > a { font-size: 18px; font-weight: 600; text-decoration: none; }
.res-section { font-size: 12.5px; color: var(--muted); margin: 2px 0 6px; }
.results p { margin: 0; line-height: 1.55; color: #4a433d; }

.footer { margin-top: auto; padding: 26px 0; color: var(--muted); font-size: 13px; display: flex; gap: 18px; border-top: 1px solid var(--line); margin-top: 56px; }

/* Просмотр картинки крупно */
.zoom { position: fixed; inset: 0; z-index: 100; background: rgba(30,26,22,.82); display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.zoom img { max-width: 100%; max-height: 100%; border-radius: 8px; background: #fff; box-shadow: 0 10px 40px rgba(0,0,0,.4); }

@media (max-width: 1180px) { .toc { display: none; } }
@media (max-width: 900px) {
  .menu-btn { display: block; }
  .topbar { padding: 0 12px; gap: 10px; }
  .logo small { display: none; }
  .sidebar { position: fixed; left: 0; top: 64px; z-index: 25; transform: translateX(-100%); transition: transform .2s; box-shadow: 4px 0 20px rgba(0,0,0,.08); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: 64px 0 0 0; background: rgba(0,0,0,.25); z-index: 20; }
  .main { padding: 22px 16px 0; }
  .article h1 { font-size: 26px; }
  .hero h1 { font-size: 28px; }
  .search.big .btn { display: none; }
  .admin-link { display: none; }
}

@media (max-width: 600px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .logo img { height: 19px; }
  .topbar .search input { padding-left: 34px; background-position: 11px center; }
}
