/* ================= Каталог «Белый список» — публичные стили ================= */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #17202a;
  --muted: #5b6675;
  --border: #e3e7ec;
  --brand: #1f6feb;
  --brand-ink: #ffffff;
  --accent: #0ea472;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 8px 24px rgba(16,24,40,.05);
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117; --surface: #161b22; --surface-2: #1c2330;
    --text: #e6edf3; --muted: #9aa7b4; --border: #2a313c;
    --brand: #4c8dff; --accent: #2ecc9a;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
  line-height: 1.6; font-size: 16px; -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word; overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
h1,h2,h3,p,li,a,span,strong { overflow-wrap: anywhere; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3 { line-height: 1.25; color: var(--text); }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 12px; top: 12px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 100; }

/* Header (не плавающая — обычный поток) */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 0 16px; flex-wrap: wrap; }
.header-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; font-weight: 700; flex: 0 0 auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-size: 16px; }
.brand-text small { color: var(--muted); font-size: 12px; }
.main-nav { display: flex; gap: 18px; align-items: center; font-size: 15px; }
.main-nav a { color: var(--muted); }
.main-nav a:hover { color: var(--text); text-decoration: none; }
.nav-admin { color: var(--brand) !important; }
.nav-toggle { display: none; }

/* Hero */
.hero { padding: 44px 0 20px; }
.hero h1 { font-size: clamp(28px, 4.5vw, 42px); margin: 0 0 12px; letter-spacing: -.02em; }
.hero-lead { font-size: clamp(16px, 2vw, 19px); color: var(--muted); max-width: 720px; margin: 0 0 20px; }
.hero-stats { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.hero-stats span { color: var(--muted); }
.hero-stats strong { color: var(--text); font-size: 20px; }

/* Buttons */
.btn { display: inline-block; padding: 11px 18px; border-radius: 10px; background: var(--surface-2);
  color: var(--text); border: 1px solid var(--border); font-weight: 600; font-size: 15px; cursor: pointer; }
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn-primary { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.btn-primary:hover { filter: brightness(1.06); }

/* Category chips */
.cat-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 14px; font-weight: 500; }
.chip:hover { border-color: var(--brand); text-decoration: none; }
.chip-count { color: var(--muted); font-size: 12px; background: var(--surface-2); border-radius: 999px; padding: 1px 8px; }

/* Sections */
.cat-section { margin: 36px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.section-head h2 { font-size: 22px; margin: 0; }
.section-all { font-size: 14px; color: var(--muted); white-space: nowrap; }
.section-desc { color: var(--muted); margin: 4px 0 16px; }

/* Grid + cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; min-width: 0; overflow: hidden; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: transparent; }
.card-link { display: block; padding: 18px; color: var(--text); height: 100%; min-width: 0; }
.card-link:hover { text-decoration: none; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; min-width: 0; }
.card-title { font-size: 17px; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.card-desc { color: var(--muted); font-size: 14px; margin: 0 0 12px; min-width: 0; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-more { color: var(--brand); font-size: 14px; font-weight: 600; }

/* Logos / monogram */
.svc-logo { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; flex: 0 0 auto; background: var(--surface-2); }
.svc-monogram { display: grid; place-items: center; font-weight: 700; font-size: 20px; color: #fff;
  background: hsl(var(--h, 210) 60% 45%); }

/* CTA */
.cta-block { margin: 48px 0; padding: 32px; text-align: center; border-radius: var(--radius);
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 12%, var(--surface)), var(--surface));
  border: 1px solid var(--border); }
.cta-block h2 { margin: 0 0 8px; }
.cta-block p { color: var(--muted); margin: 0 0 18px; }

/* Breadcrumbs */
.breadcrumbs { padding-top: 16px; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; font-size: 14px; }
.breadcrumbs li:not(:last-child)::after { content: "/"; color: var(--muted); margin-left: 6px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs span { color: var(--text); }

/* Service page */
.service-head { display: flex; gap: 18px; align-items: center; padding: 26px 0 10px; }
.service-head .svc-logo { width: 72px; height: 72px; border-radius: 16px; }
.service-head-text h1 { margin: 0 0 4px; font-size: clamp(24px, 4vw, 34px); }
.service-cat { font-size: 14px; color: var(--brand); }
.service-lead { color: var(--muted); margin: 8px 0 0; }
.service-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 18px 0; }
.service-url { font-size: 13px; word-break: break-all; }
.service-body { margin: 10px 0 28px; }
.related { margin: 32px 0; }
.related h2 { font-size: 20px; }
.back-link { margin: 30px 0; }

/* Карта на странице сервиса */
.service-map-block { margin: 30px 0; }
.service-map-block h2 { font-size: 20px; margin: 0 0 4px; }
.map-locate { margin: 12px 0; }
.service-map { width: 100%; max-width: 100%; height: 380px; margin-top: 6px;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: var(--surface-2); }
.service-map * { max-width: none; }  /* внутренние тайлы Яндекса не ограничивать */
.map-msg { padding: 16px; color: var(--muted); }
.map-fallback { display: grid; place-items: center; gap: 14px; height: 100%; text-align: center; padding: 24px; }
.map-fallback p { margin: 0; color: var(--muted); }
@media (max-width: 560px) { .service-map { height: 300px; } }

/* Блог */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin: 24px 0; }
.blog-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; min-width: 0; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.blog-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: transparent; }
.blog-card-link { display: block; color: var(--text); height: 100%; }
.blog-card-link:hover { text-decoration: none; }
.blog-cover { display: block; width: 100%; aspect-ratio: 40 / 21; object-fit: cover; background: var(--surface-2); }
.blog-cover-logo { display: grid; place-items: center; }
.blog-cover-logo img { width: 56px; height: 56px; border-radius: 14px; }
.blog-card-body { padding: 16px 18px; }
.blog-tag { display: inline-block; font-size: 12px; font-weight: 600; color: var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, var(--surface)); border-radius: 999px; padding: 3px 10px; margin-bottom: 8px; }
.blog-card-title { font-size: 17px; margin: 0 0 8px; overflow-wrap: anywhere; }
.blog-card-lead { color: var(--muted); font-size: 14px; margin: 0 0 12px; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Пагинация */
.pager { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 30px 0; flex-wrap: wrap; }
.pager-btn { padding: 9px 16px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-weight: 600; }
.pager-btn:hover { border-color: var(--brand); text-decoration: none; }
.pager-info { color: var(--muted); font-size: 14px; }

/* Статья */
.article-meta { margin: 0 0 14px; font-size: 14px; }
.article-lead { font-size: 18px; color: var(--muted); margin: 0 0 20px; }
.article-faq { margin-top: 34px; }
.article-faq h2 { font-size: 20px; }
.article-cta { margin: 28px 0; }

/* Статьи о сервисе */
.svc-articles { margin: 32px 0; }
.svc-articles h2 { font-size: 20px; margin: 0 0 12px; }
.svc-articles-list { margin: 0; padding-left: 20px; }
.svc-articles-list li { margin: 8px 0; }
.svc-articles-list a { font-weight: 600; }

/* Внутренняя перелинковка */
.see-also { margin: 32px 0; }
.see-also h2, .other-cats h2 { font-size: 20px; margin: 0 0 12px; }
.see-also-list { margin: 0; padding-left: 20px; }
.see-also-list li { margin: 8px 0; color: var(--muted); }
.see-also-list a { font-weight: 600; }
.other-cats { margin: 32px 0; }

/* Category hero */
.cat-hero { padding: 26px 0 6px; }
.cat-hero h1 { font-size: clamp(26px, 4vw, 36px); margin: 0 0 8px; }
.cat-seo { margin: 40px auto 10px; padding-top: 26px; border-top: 1px solid var(--border); max-width: 820px; }
.cat-seo h2 { font-size: 20px; }

/* Prose */
.prose { max-width: 760px; }
.prose h2 { font-size: 22px; margin: 26px 0 10px; }
.prose h3 { font-size: 18px; margin: 20px 0 8px; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose a { text-decoration: underline; }
.prose blockquote { border-left: 3px solid var(--brand); margin: 16px 0; padding: 6px 16px; color: var(--muted); }
.prose code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.intro-block { margin: 8px 0 16px; }

/* Forms */
.form-wrap, .notice-center { max-width: 640px; margin: 30px auto; }
.stack-form { display: flex; flex-direction: column; gap: 16px; margin-top: 20px; }
.stack-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.stack-form input, .stack-form textarea, .stack-form select {
  font: inherit; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); width: 100%; }
.stack-form input:focus, .stack-form textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.req { color: #e5484d; }
.hp { position: absolute; left: -9999px; }

/* Flash / notices */
.flashes { margin: 16px 0; }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 10px; font-size: 14px; }
.flash-ok { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border: 1px solid var(--accent); }
.flash-err { background: color-mix(in srgb, #e5484d 14%, var(--surface)); border: 1px solid #e5484d; }
.flash ul { margin: 0; padding-left: 18px; }
.notice-center { text-align: center; padding: 40px 0; }
.notice-ico { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 18px;
  font-size: 30px; background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; }
.empty { color: var(--muted); padding: 30px 0; }

/* Nav CTA */
.nav-cta { color: var(--accent) !important; font-weight: 600; }
.nav-cta:hover { text-decoration: underline !important; }

/* Documents / info pages */
.doc { max-width: 820px; margin: 20px auto; }
.doc h1 { font-size: clamp(26px, 4vw, 36px); margin: 10px 0 18px; }
.note-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 22px; margin: 24px 0; max-width: 100%; }
.note-box h3 { margin: 0 0 8px; }

/* FAQ */
.faq-list { margin: 20px 0; display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px 18px; }
.faq-item summary { cursor: pointer; font-weight: 600; padding: 14px 0; list-style: none; font-size: 17px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: "＋"; color: var(--brand); margin-right: 10px; font-weight: 700; }
.faq-item[open] summary::before { content: "－"; }
.faq-answer { padding-bottom: 14px; }

/* Petition generator */
.doc-form { margin: 22px 0; }
.form-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.doc-actions { display: flex; gap: 10px; margin: 18px 0; flex-wrap: wrap; }
.gen-doc { margin: 20px 0; }
.gen-doc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.gen-doc-head h2 { font-size: 18px; margin: 0; }
.doc-text { white-space: pre-wrap; word-wrap: break-word; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13.5px; line-height: 1.55; overflow-x: auto; }
@media (max-width: 620px) { .form-grid2 { grid-template-columns: 1fr; } }
@media print {
  .no-print, .site-header, .site-footer, .breadcrumbs { display: none !important; }
  .doc-text { border: none; padding: 0; white-space: pre-wrap; font-size: 12pt; }
  body { background: #fff; }
}

/* Footer */
.site-footer { margin-top: 64px; border-top: 1px solid var(--border); background: var(--surface); padding: 40px 0 28px; }
.footer-top { display: flex; justify-content: space-between; gap: 32px 56px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 12px; color: var(--text); flex: 0 0 auto; }
.footer-brand:hover { text-decoration: none; }
.footer-brand .brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; font-weight: 700; }
.footer-brand .brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.footer-brand .brand-text small { color: var(--muted); font-size: 12px; }
.footer-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px 40px; flex: 1 1 340px; max-width: 640px; }
.footer-nav a { color: var(--muted); font-size: 14px; line-height: 1.3; }
.footer-nav a:hover { color: var(--text); }
.footer-bottom { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--border); }
.footer-bottom p { margin: 5px 0; color: var(--muted); font-size: 13px; }
/* ===== Мобильное бургер-меню (шапка) ===== */
@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 5px; width: 44px; height: 44px; padding: 0; border: 1px solid var(--border);
    border-radius: 10px; background: var(--surface); cursor: pointer; flex: 0 0 auto;
  }
  .nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text);
    border-radius: 2px; transition: transform .2s ease, opacity .2s ease; transform-origin: center; }
  .site-header.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .site-header.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .site-header.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .header-bar { width: 100%; min-height: 56px; }
  .main-nav {
    display: none; order: 3; flex-basis: 100%; width: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    margin: 0; padding: 4px 0 8px; border-top: 1px solid var(--border);
  }
  .site-header.nav-open .main-nav { display: flex; }
  .main-nav a { padding: 15px 2px; border-bottom: 1px solid var(--border);
    font-size: 16px; color: var(--text); }
  .main-nav a:last-child { border-bottom: none; }
}

/* ===== Мобильный футер ===== */
@media (max-width: 560px) {
  .site-footer { padding: 32px 0 24px; }
  .footer-top { gap: 18px; }
  .footer-brand { flex-basis: 100%; }
  .footer-nav { grid-template-columns: 1fr; gap: 0; flex-basis: 100%; max-width: none; }
  .footer-nav a { padding: 13px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
  .footer-nav a:first-child { border-top: 1px solid var(--border); }
}

/* ===== Общий мобильный полишинг ===== */
@media (max-width: 560px) {
  .container { padding: 0 16px; }
  .header-inner { min-height: 56px; }
  .service-head { flex-direction: column; align-items: flex-start; text-align: left; }
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card-link { padding: 14px; }
  .card-title { font-size: 16px; }
  .svc-logo { width: 40px; height: 40px; }
  .hero { padding: 28px 0 12px; }
  .cat-chips { gap: 8px; }
}
@media (max-width: 380px) {
  .grid { grid-template-columns: 1fr; }
  .brand-text small { display: none; }
}
