/* s3.mnogomed.ru */
:root {
  --bg: #0f1419;
  --surface: #1a222d;
  --border: #2a3544;
  --text: #e8edf4;
  --muted: #8b9aaf;
  --accent: #3d8bfd;
  --accent-dim: #2563c4;
  --success: #34d399;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 10px;
  --max: 920px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(ellipse 120% 80% at 50% -20%, #1e3a5f 0%, transparent 55%);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--surface);
  color: var(--text);
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(15, 20, 25, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo span {
  color: var(--accent);
}

.logo:hover {
  text-decoration: none;
}

nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

nav a {
  color: var(--muted);
  font-size: 0.95rem;
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: none;
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.hero {
  padding: 2.5rem 0 2rem;
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.lead {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 52ch;
  margin: 0 0 1.5rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-dim);
  text-decoration: none;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--muted);
  text-decoration: none;
}

.grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 2.5rem;
}

@media (min-width: 640px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
}

.card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.section-title {
  margin: 2.5rem 0 1rem;
  font-size: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.meta-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--muted);
}

.meta-list li {
  margin-bottom: 0.35rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: auto;
  padding: 2rem 1.25rem;
  background: var(--surface);
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 560px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

.footer-col h3 {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.footer-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.35rem;
}

.footer-col a {
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-col a:hover {
  color: var(--text);
}

.copyright {
  max-width: var(--max);
  margin: 0 auto;
  padding-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  grid-column: 1 / -1;
}

.footer-simple {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.footer-nav a {
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-nav a:hover {
  color: var(--text);
}

.footer-simple .copyright {
  padding-top: 0;
  margin: 0;
}

.page-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 3vw, 1.85rem);
}

.prose {
  color: var(--muted);
}

.prose h2 {
  color: var(--text);
  font-size: 1.15rem;
  margin: 1.75rem 0 0.5rem;
}

.prose p {
  margin: 0 0 1rem;
}

.prose ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.address-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 1rem;
  font-style: normal;
  line-height: 1.7;
}

.notice {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1rem;
  background: rgba(61, 139, 253, 0.08);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  color: var(--muted);
}

code {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", monospace;
  font-size: 0.9em;
  background: var(--bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
}

th {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

td {
  color: var(--muted);
}

/* --- Справочная система (/docs/) --- */
body.docs-body main {
  max-width: none;
  padding: 0;
}

.docs-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  display: grid;
  grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

@media (max-width: 960px) {
  .docs-shell {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: relative;
    top: 0;
    max-height: none;
  }
}

.docs-sidebar {
  position: sticky;
  top: 4.5rem;
  align-self: start;
  max-height: calc(100vh - 5rem);
  overflow-y: auto;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.docs-sidebar-title {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.docs-toc {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.88rem;
  line-height: 1.45;
}

.docs-toc li {
  margin-bottom: 0.4rem;
}

.docs-toc a {
  color: var(--muted);
}

.docs-toc a:hover {
  color: var(--text);
}

.docs-toc-current > a {
  color: var(--accent);
  font-weight: 600;
}

.docs-toc-back {
  margin: 1rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.docs-main {
  max-width: 720px;
  padding: 0 !important;
}

.docs-crumb {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

.docs-lead {
  font-size: 1.05rem;
  line-height: 1.65;
  margin: 0 0 1.25rem;
}

.docs-index-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  counter-reset: docsec;
}

.docs-index-list li {
  margin-bottom: 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.docs-index-list li:last-child {
  border-bottom: none;
}

.docs-index-list a {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  color: var(--text);
}

.docs-index-list a:hover {
  color: var(--accent);
}

.toc-num {
  color: var(--muted);
  font-size: 0.9rem;
  min-width: 2rem;
}

.chapter-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}

.chapter-pager-prev,
.chapter-pager-next {
  color: var(--accent);
}

.chapter-pager-disabled {
  color: var(--border);
  cursor: default;
}
