:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #000;
  background: #f4f4f4;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
.shell { min-height: 100vh; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 22px 7vw; background: #fff; border-bottom: 1px solid #e5e5e5; }
.topbar nav, .site-footer nav { display: flex; gap: 22px; align-items: center; }
.topbar a, .site-footer a { color: inherit; text-decoration: none; }
.brand { font-size: 24px; font-weight: 800; letter-spacing: -0.04em; }
.brand span { color: #000; font-size: 13px; vertical-align: top; margin-left: 2px; }
.main { max-width: 980px; margin: 0 auto; padding: 72px 24px; }
.eyebrow { color: #000; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
h1 { max-width: 700px; font-size: clamp(40px, 7vw, 76px); line-height: .98; letter-spacing: -.06em; margin: 18px 0; }
h2 { letter-spacing: -.035em; }
.lead { max-width: 650px; color: #4e4e4e; font-size: 19px; line-height: 1.55; }
.panel { background: #fff; border: 1px solid #e5e5e5; border-radius: 18px; padding: 28px; box-shadow: 0 16px 50px rgba(0, 0, 0, .06); }
.catalog-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin: 70px 0 20px; }
.catalog-heading h2 { margin: 0 0 8px; font-size: 34px; }
.catalog-heading p { margin: 0; }
.catalog-filter { min-width: 190px; margin: 0; font-size: 13px; }
.catalog-filter select { margin-top: 7px; }
.history-catalog { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.history-card { display: block; overflow: hidden; background: #fff; border: 1px solid #e5e5e5; border-radius: 18px; text-decoration: none; transition: transform .18s ease, border-color .18s ease; }
.history-card:hover { transform: translateY(-2px); border-color: #000; }
.history-card-cover { aspect-ratio: 2.79 / 1; background: #e5e5e5 center / cover no-repeat; }
.history-card-content { padding: 22px; }
.history-card-category { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.history-card h3 { margin: 10px 0 10px; font-size: 25px; line-height: 1.08; letter-spacing: -.035em; }
.history-card p { display: -webkit-box; overflow: hidden; margin: 0 0 16px; color: #4e4e4e; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.history-card small { color: #666; }
.empty-catalog { grid-column: 1 / -1; padding: 40px 0; color: #666; }
.site-footer { display: flex; justify-content: space-between; align-items: center; padding: 28px 7vw; border-top: 1px solid #e5e5e5; background: #fff; }
.site-footer .brand { font-size: 19px; }
.site-footer .brand span { font-size: 11px; }
.about-page h1 { max-width: 800px; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 56px; }
.about-grid .panel { box-shadow: none; }
.about-grid h2 { margin-top: 0; }
.about-grid p, .about-policy li { color: #4e4e4e; line-height: 1.55; }
.about-policy { margin-top: 18px; box-shadow: none; }
.about-policy li + li { margin-top: 10px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 36px; }
.metric { background: #f7f7f7; border-radius: 12px; padding: 18px; }
.metric strong { display: block; font-size: 30px; margin-top: 6px; }
label { display: block; font-weight: 700; margin-bottom: 8px; }
input { width: 100%; border: 1px solid #ccc; border-radius: 10px; padding: 13px 14px; font: inherit; }
textarea, select { width: 100%; border: 1px solid #ccc; border-radius: 10px; padding: 13px 14px; font: inherit; }
input:focus, textarea:focus, select:focus, button:focus-visible { border-color: #000; outline: 1px solid #000; outline-offset: 1px; box-shadow: none; }
button { border: 0; border-radius: 999px; padding: 13px 18px; background: #000; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
button:hover { background: #000; }
.notice { margin-top: 16px; color: #4e4e4e; min-height: 24px; }
.muted { color: #4e4e4e; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.source-list { display: grid; gap: 10px; }
.source-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 13px 0; border-top: 1px solid #e5e5e5; }
.source-row small { display: block; color: #666; margin-top: 3px; }
.status { border-radius: 999px; padding: 5px 9px; background: #eee; color: #555; font-size: 12px; font-weight: 700; }
.status.active { background: #000; color: #fff; }
.status.disabled { background: #d9d9d9; color: #000; }
.source-row button { padding: 8px 12px; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid input { margin-top: 6px; }
.form-actions { margin-top: 16px; display: flex; gap: 12px; align-items: center; }
.history-import-text { min-height: 320px; margin-top: 6px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; line-height: 1.55; }
.import-preview { margin-top: 22px; border-top: 1px solid #d8d8d8; padding-top: 22px; }
.import-heading h3 { margin: 5px 0; font-size: 24px; letter-spacing: -.025em; }
.import-heading small { color: #666; }
.import-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 20px 0; }
.import-metrics div { background: #f3f3f3; padding: 12px; border-radius: 10px; }
.import-metrics strong, .import-metrics span { display: block; }
.import-metrics strong { font-size: 24px; }
.import-metrics span { margin-top: 3px; color: #666; font-size: 12px; }
.import-safety { max-width: 700px; font-size: 14px; line-height: 1.5; }
.import-issues { margin: 18px 0 0; padding: 0; list-style: none; border-top: 1px solid #e5e5e5; }
.import-issues li { padding: 12px 0; border-bottom: 1px solid #e5e5e5; line-height: 1.45; }
.import-issues li.error strong { color: #b00020; }
.profile-list { display: grid; gap: 10px; margin-top: 20px; }
.profile-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 13px 0; border-top: 1px solid #e5e5e5; }
.profile-row small { display: block; color: #666; margin-top: 3px; }
.profile-row button { padding: 8px 12px; font-size: 13px; }
.section-copy { max-width: 680px; margin: 6px 0 0; color: #4e4e4e; font-size: 14px; line-height: 1.45; }
.editor-inbox-panel { margin-bottom: 18px; }
.reader-contributions-panel { margin-bottom: 18px; }
.inbox-summary { display: flex; align-items: center; gap: 28px; margin-top: 18px; padding: 16px 0; border-top: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5; }
.inbox-total { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.inbox-total strong { font-size: 28px; }
.inbox-total span, .inbox-breakdown { color: #666; font-size: 13px; }
.inbox-breakdown { display: flex; flex-wrap: wrap; gap: 12px 18px; }
.inbox-breakdown b { color: #000; }
.inbox-list { display: grid; max-height: 520px; overflow-y: auto; padding-right: 10px; }
.inbox-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 15px 0; border-bottom: 1px solid #e5e5e5; }
.inbox-main small { display: block; margin-top: 4px; color: #666; line-height: 1.35; }
.inbox-count { min-width: 28px; text-align: center; font-size: 18px; }
.inbox-empty { color: #666; font-size: 14px; }
.reader-contributions-list { display: grid; gap: 0; max-height: 620px; overflow-y: auto; padding-right: 10px; }
.reader-contribution-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 16px 0; border-top: 1px solid #e5e5e5; }
.reader-contribution-main { min-width: 0; }
.reader-contribution-heading { display: flex; align-items: center; gap: 10px; }
.reader-contribution-main small { display: block; margin-top: 6px; color: #666; line-height: 1.35; overflow-wrap: anywhere; }
.reader-contribution-main p { margin: 12px 0 0; line-height: 1.45; white-space: pre-wrap; }
.reader-contribution-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: 280px; }
.reader-contribution-actions button { padding: 8px 12px; font-size: 13px; }
.legal-registry-panel { margin-bottom: 18px; }
.legal-registry-import-form { margin-top: 18px; border-top: 1px solid #e5e5e5; padding-top: 18px; }
.legal-import-preview { margin-top: 18px; border-top: 1px solid #e5e5e5; padding-top: 18px; }
.legal-import-metrics { margin-bottom: 0; }
.legal-registry-form { margin-top: 18px; border-top: 1px solid #e5e5e5; padding-top: 18px; }
.legal-registry-list { display: grid; gap: 10px; margin-top: 22px; max-height: 520px; overflow-y: auto; padding-right: 10px; }
.legal-registry-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid #e5e5e5; }
.legal-registry-row small { display: block; margin-top: 5px; color: #666; overflow-wrap: anywhere; }
.legal-registry-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.legal-registry-actions button { padding: 8px 12px; font-size: 13px; }
.banner-admin-panel { margin-top: 18px; }
.banner-form { margin-top: 18px; border-top: 1px solid #e5e5e5; padding-top: 18px; }
.banner-admin-list { display: grid; gap: 10px; margin-top: 22px; }
.banner-admin-row { display: grid; grid-template-columns: 82px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid #e5e5e5; }
.banner-admin-thumb { width: 82px; aspect-ratio: 321 / 491; background: #e5e5e5 center / cover no-repeat; }
.banner-admin-main small { display: block; margin-top: 5px; color: #666; overflow-wrap: anywhere; }
.banner-admin-main .banner-stats { margin-top: 9px; color: #000; font-weight: 700; }
.banner-admin-main .banner-activity { font-size: 12px; }
.banner-admin-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.banner-admin-actions button { padding: 8px 12px; font-size: 13px; }
.tracking-list { display: grid; gap: 10px; max-height: 560px; overflow-y: auto; padding-right: 10px; }
.list-tools { display: flex; align-items: end; gap: 14px; margin: 18px 0 4px; }
.list-tools label { display: grid; gap: 6px; min-width: 220px; color: #4e4e4e; font-size: 13px; }
.list-tools input, .list-tools select { width: 100%; }
.list-tools .muted { margin-left: auto; padding-bottom: 10px; }
.tracking-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 16px 0; border-top: 1px solid #e5e5e5; }
.tracking-main small { display: block; margin-top: 5px; color: #666; line-height: 1.35; }
.tracking-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.tracking-actions button { padding: 8px 12px; font-size: 13px; }
.button-link { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 8px 12px; font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.button-link.secondary { border: 1px solid #bbb; background: #fff; color: #000; }
.button-link.secondary:hover { border-color: #000; background: #fff; }
button.secondary { border: 1px solid #bbb; background: #fff; color: #000; }
button.secondary:hover { border-color: #000; background: #fff; }
dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 32px); border: 0; border-radius: 18px; padding: 0; overflow: auto; box-shadow: 0 24px 80px rgba(0, 0, 0, .24); }
dialog::backdrop { background: rgba(0, 0, 0, .42); }
.dialog-form { padding: 28px; }
.dialog-form h2 { margin: 0 0 6px; }
.dialog-lead { margin: 0 0 18px; color: #4e4e4e; }
.switch-row { display: flex; align-items: center; gap: 10px; margin: 18px 0 8px; }
.switch-row input { flex: 0 0 auto; width: 18px; height: 18px; margin: 0; }
.form-help { margin: 0 0 20px; color: #666; font-size: 13px; line-height: 1.45; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
@media (max-width: 700px) { .topbar { padding: 18px 20px; } .main { padding: 44px 20px; } .grid { grid-template-columns: 1fr; } .topbar nav { gap: 12px; font-size: 13px; } .catalog-heading, .site-footer { align-items: flex-start; flex-direction: column; } .history-catalog, .about-grid { grid-template-columns: 1fr; } .site-footer nav { gap: 14px; } }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } .form-grid .wide { grid-column: auto; } .profile-row { grid-template-columns: 1fr auto; } .profile-row .status { grid-column: 2; grid-row: 1; } .list-tools { align-items: stretch; flex-direction: column; } .list-tools label { min-width: 0; } .list-tools .muted { margin-left: 0; padding-bottom: 0; } .tracking-list { max-height: 520px; padding-right: 0; } .tracking-row { grid-template-columns: 1fr auto; } .tracking-actions { grid-column: 1 / -1; justify-content: flex-start; } .inbox-summary { align-items: flex-start; flex-direction: column; gap: 10px; } .inbox-list, .reader-contributions-list { max-height: 520px; padding-right: 0; } .inbox-row, .reader-contribution-row { grid-template-columns: minmax(0, 1fr) auto; } .inbox-row .button-link, .reader-contribution-actions { grid-column: 1 / -1; justify-self: start; justify-content: flex-start; } .dialog-form { padding: 20px; } }
@media (max-width: 700px) { .banner-admin-row { grid-template-columns: 64px minmax(0, 1fr); } .banner-admin-row .status { grid-column: 2; justify-self: start; } .banner-admin-actions { grid-column: 1 / -1; justify-content: flex-start; } .banner-admin-thumb { width: 64px; } }
@media (max-width: 700px) { .import-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-actions { align-items: flex-start; flex-direction: column; } }

/* Главная страница в визуальном языке страницы истории */
body.home-document { background: #fff; color: #000; font-family: 'Chronos Roboto', Arial, sans-serif; }
.home-shell { width: min(1024px, calc(100% - 40px)); margin: 0 auto; }
.home-topline { width: 100%; height: 25px; background: #000; }
.home-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 36px; min-height: 117px; padding-top: 43px; }
.home-header .brand { display: block; width: 260px; height: 77px; line-height: 0; }
.home-header .brand img { display: block; width: 260px; height: auto; }
.home-header p { width: 413px; margin: 0; padding-top: 9px; color: #5e5e5e; font-size: 16px; line-height: 1.2; }
.home-document .main { max-width: none; margin: 0; padding: 39px 0 74px; }
.home-cover-slider { position: relative; display: block; aspect-ratio: 2.35 / 1; margin-bottom: 39px; background: #eee center / cover no-repeat; color: #fff; text-decoration: none; transition: opacity .3s ease; }
.home-cover-slider.is-changing { opacity: 0; }
.home-cover-slider::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, .72) 100%); }
.home-cover-caption { position: absolute; z-index: 1; right: 20px; bottom: 30px; left: 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.home-cover-caption small { font-size: 12px; font-weight: 700; letter-spacing: .1em; }
.home-cover-caption strong { max-width: 900px; font-size: 42px; line-height: .98; letter-spacing: -.04em; }
.home-cover-caption > span { display: inline-flex; align-items: center; gap: 3px; margin-top: 6px; font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
.inline-external-icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; stroke-linejoin: miter; }
.category-nav { display: flex; flex-wrap: wrap; gap: 12px 23px; margin-bottom: 30px; border-top: 1px solid #000; border-bottom: 1px solid #000; padding: 16px 0 14px; }
.category-nav button, .category-nav a { border: 0; border-radius: 0; background: transparent; padding: 0; color: #000; font: 700 12px/1.2 'Chronos Roboto', Arial, sans-serif; letter-spacing: .08em; text-align: left; text-decoration: none; cursor: pointer; }
.category-nav button:hover, .category-nav button.is-active, .category-nav a:hover, .category-nav a.is-active { background: transparent; color: #000; text-decoration: underline; text-underline-offset: 4px; }
.category-mobile-menu { display: none; position: relative; margin-bottom: 30px; }
.category-mobile-trigger, .category-mobile-options button { width: 100%; border: 0; border-radius: 0; background: #fff; color: #000; font: 700 13px/1.2 'Chronos Roboto', Arial, sans-serif; letter-spacing: .08em; text-align: left; }
.category-mobile-trigger { display: flex; min-height: 46px; align-items: center; justify-content: space-between; border: 1px solid #000; padding: 12px 14px; cursor: pointer; }
.category-mobile-trigger svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; stroke-linejoin: miter; transition: transform .18s ease; }
.category-mobile-menu.is-open .category-mobile-trigger svg { transform: rotate(180deg); }
.category-mobile-options { position: absolute; z-index: 10; right: 0; left: 0; max-height: min(58vh, 410px); overflow-y: auto; border: 1px solid #000; border-top: 0; background: #fff; box-shadow: 0 10px 24px rgba(0, 0, 0, .12); }
.category-mobile-options button { display: block; min-height: 42px; padding: 11px 14px; cursor: pointer; }
.category-mobile-options button + button { border-top: 1px solid #dedede; }
.category-mobile-options button[aria-selected="true"] { background: #000; color: #fff; }
.category-mobile-options button:hover { background: #efefef; color: #000; }
.category-mobile-options button[aria-selected="true"]:hover { background: #000; color: #fff; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.home-document .catalog-heading { align-items: end; margin: 25px 0 28px; }
.home-document .catalog-heading h2 { margin: 0; color: #000; font-size: 24px; letter-spacing: -.03em; }
.history-count { color: #666; font-size: 13px; }
.home-document .history-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 20px; }
.home-document .history-card { overflow: visible; border: 0; border-radius: 0; background: transparent; transform: none; }
.home-document .history-card:hover { border: 0; transform: none; }
.home-document .history-card-cover { aspect-ratio: 2.79 / 1; margin-bottom: 14px; background-color: #eee; }
.home-document .history-card-content { padding: 0; }
.home-document .history-card-category { display: block; margin-bottom: 8px; color: #000; font-size: 12px; letter-spacing: .1em; }
.home-document .history-card h3 { margin: 0 0 9px; color: #000; font-size: 24px; line-height: 1.05; letter-spacing: -.035em; }
.home-document .history-card p { margin: 0; color: #666; font-size: 14px; line-height: 1.35; }
.home-document .history-card small { display: block; margin-top: 12px; color: #666; font-size: 12px; }
.category-page-heading { max-width: 760px; margin: 26px 0 36px; }
.category-page-heading p { margin: 0; color: #555; font-size: 18px; line-height: 1.4; }
.category-pagination { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; margin: 54px 0 0; padding-top: 16px; border-top: 1px solid #000; color: #666; font-size: 14px; }
.category-pagination a { color: #000; text-decoration: underline; text-underline-offset: 4px; }
.category-pagination a:last-child { text-align: right; }
.home-document .site-footer { display: flex; width: 100%; height: 122px; margin: 0; align-items: center; justify-content: space-between; padding: 0 max(calc((100% - 1024px) / 2), 20px); border: 0; border-radius: 0; background: #000; }
.home-document .site-footer .brand { display: block; width: 185px; height: 55px; line-height: 0; }
.home-document .site-footer .brand img { display: block; width: 185px; height: auto; }
.home-document .site-footer nav { gap: 22px; }
.home-document .site-footer a { color: #fff; }
.home-document .site-footer a[href="/editor"], .home-document .site-footer a[href="/editor"]:hover { color: #000; }
.footer-copyright { display: none; }
@media (max-width: 700px) {
  .home-shell { width: calc(100% - 32px); }
  .home-header { display: block; min-height: 0; padding-top: 28px; }
  .home-header .brand, .home-header .brand img { width: 220px; height: auto; }
  .home-header p { width: auto; margin-top: 22px; }
  .home-document .main { padding: 38px 0 54px; }
  .home-cover-slider { aspect-ratio: 1.55 / 1; margin-bottom: 30px; }
  .home-cover-caption { right: 18px; bottom: 18px; left: 18px; }
  .home-cover-caption strong { font-size: 28px; }
  .category-nav { display: none; }
  .category-mobile-menu { display: block; }
  .home-document .catalog-heading { display: flex; margin: 22px 0 24px; }
  .home-document .history-catalog { grid-template-columns: 1fr; gap: 30px; }
  .category-page-heading { margin: 22px 0 30px; }
  .category-page-heading p { font-size: 16px; }
  .category-pagination { margin-top: 38px; grid-template-columns: 1fr 1fr; }
  .category-pagination > span { display: none; }
  .home-document .site-footer { width: 100%; height: 132px; padding: 16px; flex-direction: column; justify-content: center; gap: 8px; text-align: center; }
  .home-document .site-footer .brand, .home-document .site-footer .brand img { width: 112px; height: auto; }
  .home-document .site-footer nav { justify-content: center; gap: 0; }
  .home-document .site-footer nav a[href="/editor"] { display: none; }
  .home-document .site-footer nav a[href="/about"] { display: block; }
  .home-document .footer-copyright { display: block; color: #fff; font-size: 11px; line-height: 1.2; }
}
@media (min-width: 701px) and (max-width: 900px) {
  .home-shell { width: calc(100% - 40px); }
  .home-document .site-footer { padding-right: 20px; padding-left: 20px; }
  .category-nav { display: none; }
  .category-mobile-menu { display: block; }
}
@media (max-width: 374px) {
  .home-header { text-align: center; }
  .home-header .brand, .home-header .brand img { width: 180px; margin-right: auto; margin-left: auto; }
  .home-header p { text-align: left; }
  .home-cover-caption strong { font-size: 22px; line-height: 1.02; }
  .home-document .history-card h3 { font-size: 18px; line-height: 1.08; }
}
