/* Проект ПТСР — оформление мини-сайта */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f0efe9;
  --ink: #16323f;
  --ink-2: #3d5865;
  --muted: #6b7f88;
  --line: #e1ded5;
  --line-2: #ebe8e0;
  --accent: #1f6f66;
  --accent-ink: #145a52;
  --accent-soft: #e3f1ee;
  --warn: #a8621a;
  --warn-soft: #fbf0e1;
  --danger: #b0413e;
  --danger-soft: #f8e6e5;
  --ok: #2e7d4f;
  --ok-soft: #e4f3ea;
  --mark: #fff1b8;
  --shadow: 0 1px 2px rgba(22, 50, 63, .06), 0 4px 16px rgba(22, 50, 63, .06);
  --radius: 12px;
  --font: 'Golos Text', 'Noto Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Onest', 'Golos Text', system-ui, sans-serif;
  --top: 60px;
  --side: 264px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1a1f; --surface: #15242b; --surface-2: #1b2d35; --ink: #e4ecee; --ink-2: #bccbd0; --muted: #8aa0a8;
    --line: #263c45; --line-2: #22363e; --accent: #4fb3a5; --accent-ink: #7fd1c4; --accent-soft: #173a37;
    --warn: #e0a35c; --warn-soft: #3a2c19; --danger: #e07a76; --danger-soft: #3b2120; --ok: #6cc596; --ok-soft: #183427;
    --mark: #5a4c12; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--font); }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-s { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -2px; margin-right: 4px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- роль: менеджер не видит закрытое ---------- */
html[data-role="manager"] .admin-only { display: none !important; }

/* ---------- верхняя панель ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 16px;
  padding: 0 20px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: calc(var(--side) - 36px); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--ink); color: var(--surface); display: grid; place-items: center;
  font: 800 18px var(--font-head);
}
.brand-text { font: 700 16px/1.1 var(--font-head); display: flex; flex-direction: column; }
.brand-text small { font: 400 12px var(--font); color: var(--muted); margin-top: 2px; }
.menu-btn { display: none; background: none; border: 0; color: var(--ink); padding: 6px; margin-left: -6px; border-radius: 8px; cursor: pointer; }
.menu-btn .ic { width: 24px; height: 24px; }

.search { position: relative; flex: 1; max-width: 560px; }
.search input {
  width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink);
  padding: 0 40px 0 38px; font: 15px var(--font); outline: none; transition: border-color .15s, background .15s;
}
.search input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-ic { position: absolute; left: 11px; top: 10px; color: var(--muted); }
.search-kbd { position: absolute; right: 10px; top: 9px; font: 12px var(--font); color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; background: var(--surface); }
.search-results {
  position: absolute; top: 46px; left: 0; right: 0; max-height: min(70vh, 640px); overflow: auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgba(22, 50, 63, .18); padding: 6px;
}
.sr-item { display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.sr-item:hover, .sr-item.sel { background: var(--accent-soft); }
.sr-page { font-size: 12px; color: var(--muted); }
.sr-head { font-weight: 600; margin: 1px 0 2px; }
.sr-snip { font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.sr-empty { padding: 14px; color: var(--muted); }
.sr-more { padding: 8px 12px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line-2); margin-top: 4px; }
mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }

.usermenu { position: relative; margin-left: auto; }
.user-btn {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  height: 38px; padding: 0 12px; border-radius: 10px; font: 14px var(--font); cursor: pointer;
}
.user-pop {
  position: absolute; right: 0; top: 46px; min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 40px rgba(22, 50, 63, .18); padding: 6px; z-index: 40;
}
.user-pop a, .user-pop button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 8px; color: var(--ink); text-decoration: none;
  background: none; border: 0; font: 14.5px var(--font); cursor: pointer; text-align: left;
}
.user-pop a:hover, .user-pop button:hover { background: var(--surface-2); }
.user-pop form { margin: 0; }

/* ---------- раскладка ---------- */
.layout { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: calc(100vh - var(--top)); }
.layout.has-toc { grid-template-columns: var(--side) minmax(0, 1fr) 248px; }
.sidebar {
  position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow: auto; padding: 18px 12px 40px;
  border-right: 1px solid var(--line); background: var(--surface);
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.nav-sec > a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: var(--ink-2); text-decoration: none;
  font-weight: 500; font-size: 15px;
}
.nav-sec > a:hover { background: var(--surface-2); color: var(--ink); }
.nav-sec.active > a { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav-sub { margin: 4px 0 10px 22px !important; padding-left: 10px !important; border-left: 1.5px solid var(--line) !important; }
.nav-page a { display: block; padding: 5px 10px; font-size: 13.8px; line-height: 1.35; color: var(--ink-2); text-decoration: none; border-radius: 6px; }
.nav-page a:hover { background: var(--surface-2); color: var(--ink); }
.nav-page a.cur { color: var(--accent-ink); font-weight: 600; background: var(--surface-2); }
.nav-group { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 12px 10px 4px; font-weight: 600; }
.scrim { display: none; }

.content { min-width: 0; padding: 36px 48px 40px; max-width: 920px; width: 100%; }
.layout.wide .content { max-width: none; }
.toc { border-left: 1px solid var(--line); }
.toc-in { position: sticky; top: calc(var(--top) + 24px); padding: 4px 18px; max-height: calc(100vh - var(--top) - 48px); overflow: auto; }
.toc-title { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li a { display: block; padding: 4px 8px; font-size: 13px; line-height: 1.35; color: var(--muted); text-decoration: none; border-left: 2px solid transparent; margin-left: -2px; }
.toc li.toc-l3 a { padding-left: 18px; font-size: 12.5px; }
.toc li a:hover { color: var(--ink); }
.toc li a.on { color: var(--accent-ink); border-left-color: var(--accent); font-weight: 600; }

.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.foot { margin-top: 64px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }

/* ---------- заголовки документов ---------- */
.kicker { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.doc-head { margin-bottom: 28px; }
.doc-head h1, .hero h1 { font: 800 clamp(28px, 3.4vw, 38px)/1.15 var(--font-head); margin: 0 0 12px; letter-spacing: -.01em; }
.lead { font-size: 18px; line-height: 1.55; color: var(--ink-2); margin: 0 0 14px; max-width: 760px; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); }
.doc-meta span { display: inline-flex; align-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 6px; }
.block-title { font: 700 22px/1.25 var(--font-head); margin: 40px 0 14px; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 500 14.5px var(--font); text-decoration: none; cursor: pointer; transition: .15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13.5px; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }

/* ---------- текст документов ---------- */
.prose { font-size: 16.5px; line-height: 1.68; }
.prose h2 { font: 700 25px/1.25 var(--font-head); margin: 46px 0 14px; padding-top: 8px; }
.prose h3 { font: 700 19px/1.3 var(--font-head); margin: 30px 0 10px; }
.prose h4 { font-size: 16.5px; margin: 22px 0 8px; }
.prose h2:first-child, .prose h3:first-child { margin-top: 8px; }
.anchor { opacity: 0; margin-left: 8px; color: var(--muted); text-decoration: none; font-weight: 400; font-size: .8em; }
h2:hover .anchor, h3:hover .anchor { opacity: 1; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 24px; margin: 0 0 16px; }
.prose li { margin: 5px 0; }
.prose li > p { margin: 0 0 6px; }
.prose strong { font-weight: 650; }
.prose blockquote { margin: 18px 0; padding: 12px 18px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; color: var(--ink-2); }
.prose blockquote p:last-child { margin: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }
.prose code, code.path { font: 13.5px ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
code.path { color: var(--muted); font-size: 12.5px; }
.prose pre { background: var(--surface-2); padding: 14px; border-radius: 10px; overflow: auto; }
.prose pre code { background: none; padding: 0; }
a.docref { display: inline-flex; align-items: baseline; gap: 2px; background: var(--accent-soft); padding: 0 6px; border-radius: 6px; text-decoration: none; font-size: .95em; }
a.docref .ic-s { align-self: center; margin-right: 2px; }
span.docref { font-style: italic; }
a.ref { font-size: 11.5px; vertical-align: super; line-height: 0; text-decoration: none; background: var(--surface-2); border-radius: 4px; padding: 1px 4px; margin: 0 1px; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; padding: 1px 7px; border-radius: 20px; vertical-align: 1px; }
.tag-assume { background: var(--warn-soft); color: var(--warn); }
.tag-kim { background: var(--accent-soft); color: var(--accent-ink); }

/* термины словаря */
abbr.term { text-decoration: underline dotted var(--muted); text-underline-offset: 3px; cursor: help; outline: none; }
abbr.term:focus-visible { background: var(--accent-soft); border-radius: 3px; }
.tip {
  position: absolute; z-index: 50; max-width: 340px; background: var(--ink); color: var(--surface); padding: 10px 13px; border-radius: 10px;
  font-size: 13.5px; line-height: 1.45; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); pointer-events: none;
}
.tip b { display: block; font-size: 12px; opacity: .75; margin-bottom: 2px; font-weight: 600; }

/* ---------- таблицы ---------- */
.table-wrap { overflow-x: auto; margin: 16px 0 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; line-height: 1.45; }
th, td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-2); }
th { background: var(--surface-2); font-weight: 600; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.wrap { min-width: 200px; }
.prose td { min-width: 110px; }

/* интерактивные таблицы */
.dt-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 8px 0 0; }
.dt-bar input, .dt-bar select, .filter-box input {
  height: 38px; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; background: var(--surface); color: var(--ink); font: 14.5px var(--font);
}
.dt-bar input { flex: 1; min-width: 200px; max-width: 380px; }
.dt-count { font-size: 13px; color: var(--muted); margin-left: auto; }
table.datatable th { cursor: pointer; user-select: none; position: sticky; top: 0; }
table.datatable th:hover { color: var(--ink); }
table.datatable th[aria-sort="ascending"]::after { content: ' ▲'; font-size: 10px; }
table.datatable th[aria-sort="descending"]::after { content: ' ▼'; font-size: 10px; }
.dt .table-wrap { max-height: 75vh; overflow: auto; }
.filter-box { margin: 0 0 10px; }
.filter-box input { width: 100%; max-width: 420px; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill-a { background: var(--accent-soft); color: var(--accent-ink); }
.pill-b { background: var(--warn-soft); color: var(--warn); }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-off { background: var(--danger-soft); color: var(--danger); }

/* ---------- карточки ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card-link {
  display: flex; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s, box-shadow .15s;
}
.card-link:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); color: var(--ink); }
.cl-ic { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.cl-title { font-weight: 650; line-height: 1.3; margin-bottom: 4px; }
.cl-text { font-size: 14px; color: var(--ink-2); line-height: 1.45; }
.cl-extra { font-size: 12px; color: var(--muted); margin-top: 8px; }
.cards-compact .card-link { padding: 14px; }
.cards-compact .cl-ic { width: 34px; height: 34px; }
.cards-sections .cl-title { font-size: 17px; }
html[data-role="manager"] .cards-sections .card-link:not([href="/prodazhi/"]) { display: none; }

/* ---------- плашки ---------- */
.callout { display: flex; gap: 12px; padding: 14px 18px; border-radius: var(--radius); background: var(--accent-soft); color: var(--ink); margin: 18px 0; line-height: 1.55; }
.callout .ic { color: var(--accent-ink); margin-top: 2px; }
.callout-warn { background: var(--warn-soft); }
.callout-warn .ic { color: var(--warn); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.panel h2 { font: 700 19px var(--font-head); margin: 0 0 14px; }
.panel h2.mt { margin-top: 24px; }
.panel-ok { border-top: 3px solid var(--ok); }
.panel-wait { border-top: 3px solid var(--warn); }
.two-col, .home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0; }
.home-grid { grid-template-columns: 1.15fr 1fr; }

/* главная */
.hero { padding: 6px 0 4px; }
.hero h1 { font-size: clamp(30px, 4vw, 44px); max-width: 760px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 24px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat-v { font: 800 28px/1.1 var(--font-head); color: var(--accent-ink); margin-bottom: 6px; white-space: nowrap; }
.stat-c { font-size: 13.5px; color: var(--ink-2); line-height: 1.4; }
.report-head .stats { margin-top: 22px; }

.status { list-style: none; margin: 0; padding: 0; position: relative; }
.status li { display: grid; grid-template-columns: 16px 76px 1fr; gap: 10px; padding: 7px 0; position: relative; }
.status li::before { content: ''; position: absolute; left: 7px; top: 22px; bottom: -8px; width: 2px; background: var(--line); }
.status li:last-child::before { display: none; }
.st-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); margin-top: 4px; z-index: 1; }
.st-done .st-dot { background: var(--ok); border-color: var(--ok); }
.st-next .st-dot { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 4px var(--accent-soft); }
.st-wait .st-dot { border-color: var(--warn); }
.st-when { font-size: 12.5px; color: var(--muted); padding-top: 2px; }
.st-what b { display: block; font-weight: 600; font-size: 15px; line-height: 1.35; }
.st-what small { color: var(--muted); font-size: 13px; }
.st-plan .st-what b { color: var(--ink-2); font-weight: 500; }
.openlist-s { padding-left: 20px; margin: 0 0 8px; }
.openlist-s li { margin: 6px 0; font-size: 15px; }
.howto { padding-left: 20px; margin: 0; }
.howto li { margin: 6px 0; font-size: 15px; }
.more { font-size: 14px; font-weight: 500; text-decoration: none; }

/* решения */
.checklist, .openlist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 10px; padding: 7px 0; line-height: 1.5; font-size: 15px; border-bottom: 1px solid var(--line-2); }
.checklist li:last-child, .openlist li:last-child { border: 0; }
.checklist .ic { color: var(--ok); margin-top: 2px; }
.openlist li { padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 15px; }
.openlist li b { display: block; }
.openlist li span { color: var(--muted); font-size: 14px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 70px 1fr; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.tl-date { font: 700 20px/1 var(--font-head); color: var(--accent-ink); }
.tl-date small { display: block; font: 12px var(--font); color: var(--muted); margin-top: 4px; }
.tl-body { font-size: 15px; line-height: 1.6; }

/* продажи */
.sales-top { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.hero-card {
  display: flex; gap: 12px; align-items: center; padding: 16px; border-radius: var(--radius); background: var(--ink); color: var(--surface);
  text-decoration: none; transition: transform .15s;
}
.hero-card:hover { transform: translateY(-1px); color: var(--surface); }
.hero-card .ic { width: 28px; height: 28px; opacity: .9; }
.hero-card b { display: block; }
.hero-card small { opacity: .75; font-size: 13px; }
.hero-card:nth-child(2) { background: var(--accent); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.steps a {
  display: flex; gap: 14px; align-items: center; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  text-decoration: none; color: var(--ink);
}
.steps a:hover { border-color: var(--accent); }
.steps b { display: block; }
.steps small { color: var(--muted); font-size: 13.5px; }
.step-n { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; flex: none; }
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 40px; }
.pn { padding: 14px 18px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; background: var(--surface); }
.pn small { display: block; color: var(--muted); font-size: 12px; }
.pn.next { text-align: right; grid-column: 2; }
.pn:hover { border-color: var(--accent); }
.letter { margin: 26px 0; padding: 22px 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.letter-head { display: flex; align-items: center; gap: 10px; color: var(--accent-ink); }
.letter-head h2 { margin: 0 !important; padding: 0 !important; font-size: 19px !important; color: var(--ink); }
.pdf-frame { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; height: 80vh; background: var(--surface-2); }
.pdf-frame iframe { width: 100%; height: 100%; border: 0; }

/* исследования */
.rawlist { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 24px; }
.rawlist li { break-inside: avoid; margin: 0 0 6px; }
.rawlist a { display: flex; gap: 10px; align-items: baseline; text-decoration: none; color: var(--ink); padding: 5px 8px; border-radius: 8px; }
.rawlist a:hover { background: var(--surface); }
.raw-id { font: 600 12px ui-monospace, monospace; color: var(--accent-ink); background: var(--accent-soft); padding: 1px 6px; border-radius: 5px; min-width: 34px; text-align: center; }

/* словарь */
.glossary { margin: 0 0 20px; display: grid; gap: 8px; }
.gl-item { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.gl-item:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.glossary dt { font-weight: 700; font-size: 16px; }
.gl-alt { font-weight: 400; font-size: 12.5px; color: var(--muted); margin-left: 8px; }
.gl-alt + .gl-alt::before { content: '· '; }
.glossary dd { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.5; }

/* ---------- служебные страницы (вход, пользователи) ---------- */
.svc { background: var(--bg); }
.svc-wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px 60px; }
.svc-narrow .svc-wrap { max-width: 560px; }
.svc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0; flex-wrap: wrap; }
.svc-nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.svc-nav a { padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-size: 14.5px; }
.svc-nav a:hover { background: var(--surface); }
.svc-user { font-size: 13px; color: var(--muted); padding-left: 8px; }
.svc-title h1 { font: 800 30px var(--font-head); margin: 10px 0 6px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin: 16px 0; }
.card h1 { font: 800 26px var(--font-head); margin: 0 0 10px; }
.card h2 { font: 700 18px var(--font-head); margin: 0 0 14px; }
.card form { margin: 0; }
.card label, .login-card label { display: block; font-size: 14px; font-weight: 500; margin: 0 0 14px; }
.card input[type=text], .card input[type=password], .card input:not([type]), .card select, .login-card input {
  display: block; width: 100%; height: 42px; margin-top: 6px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--ink); font: 15px var(--font);
}
.card input:focus, .login-card input:focus, .card select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.add-form { display: grid; grid-template-columns: 1fr 180px 1.3fr auto; gap: 12px; align-items: end; }
.add-form label { margin: 0; }
.add-form .btn { height: 42px; }
.login-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 34px 32px 26px; margin-top: 8vh; box-shadow: var(--shadow);
}
.login-card h1 { font: 800 28px var(--font-head); margin: 14px 0 6px; }
.login-card .btn { width: 100%; justify-content: center; height: 46px; font-size: 16px; margin-top: 4px; }
.login-mark { width: 48px; height: 48px; border-radius: 12px; background: var(--ink); color: var(--surface); display: grid; place-items: center; font: 800 24px var(--font-head); }
.alert { padding: 12px 16px; border-radius: 10px; margin: 14px 0; font-size: 14.5px; }
.alert-err { background: var(--danger-soft); color: var(--danger); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.secret { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--ink); }
.secret-pw { font: 600 18px ui-monospace, monospace; background: var(--surface); border: 1px dashed var(--ok); padding: 6px 12px; border-radius: 8px; user-select: all; }
table.users td { vertical-align: middle; }
.row-actions summary { cursor: pointer; color: var(--accent-ink); font-size: 14px; list-style: none; }
.row-actions summary::-webkit-details-marker { display: none; }
.row-actions[open] summary { margin-bottom: 8px; }
.act-grid { display: flex; flex-direction: column; gap: 8px; min-width: 220px; }
.inline-form, .confirm-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form select { height: 32px !important; width: auto !important; margin: 0 !important; display: inline-block !important; }
.confirm-form label { margin: 0 !important; font-weight: 400 !important; display: inline-flex !important; gap: 4px; align-items: center; }
table.log { font-size: 13px; }
tr.ev-login_fail td, tr.ev-ip_blocked td, tr.ev-user_locked td, tr.ev-login_blocked_ip td { color: var(--danger); }

/* ---------- адаптив ---------- */
@media (max-width: 1280px) {
  .layout.has-toc { grid-template-columns: var(--side) minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 960px) {
  .menu-btn { display: block; }
  .brand { min-width: 0; }
  .brand-text small { display: none; }
  .layout, .layout.has-toc { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: var(--top); bottom: 0; width: 290px; height: auto; z-index: 25; transform: translateX(-100%);
    transition: transform .2s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .15);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: var(--top) 0 0 0; background: rgba(15, 26, 31, .35); z-index: 20; }
  .content { padding: 24px 20px 32px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .two-col, .home-grid, .sales-top { grid-template-columns: 1fr; }
  .add-form { grid-template-columns: 1fr; }
  .search-kbd { display: none; }
}
@media (max-width: 600px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .brand-text { display: none; }
  .user-btn span { display: none; }
  .user-btn { padding: 0 9px; }
  .lead { font-size: 16.5px; }
  .prose { font-size: 16px; }
  .stat-v { font-size: 23px; white-space: normal; }
  .rawlist { columns: 1; }
  .timeline li { grid-template-columns: 1fr; gap: 6px; }
  .tl-date { font-size: 16px; }
  .tl-date small { display: inline; margin-left: 6px; }
  .prevnext { grid-template-columns: 1fr; }
  .pn.next { grid-column: 1; }
  .pdf-frame { display: none; }
  .status li { grid-template-columns: 16px 62px 1fr; }
}
@media print {
  .topbar, .sidebar, .toc, .foot, .actions, .prevnext { display: none !important; }
  .layout { display: block; }
  .content { max-width: none; padding: 0; }
  body { background: #fff; }
}
.dt table { font-size: 13.5px; }
.dt td.wrap { min-width: 180px; }
