/* ═══════════════════════════════════════════════════════════════════════
   NanoFarm · «ЮРИДИЧЕСКАЯ ИНФОРМАЦИЯ» (.nf-legal)
   Заголовок без плашки · слева закреплённое меню документов ·
   справа документ в белой карточке, удобной для чтения.
   Разметка pages/legal.html не меняется (вкладки работают как прежде).
   ═══════════════════════════════════════════════════════════════════════ */

html body {
  --lg-card: #ffffff;
  --lg-line: rgba(55, 53, 54, 0.09);
  --lg-text: #1f1e1f;
  --lg-body: #4a4745;
  --lg-muted: #77736f;
  --lg-teal: #4da0a9;
  --lg-teal-ink: #2f7f88;
  --lg-teal-soft: rgba(77, 160, 169, 0.1);
}
html[data-theme="dark"] body {
  --lg-card: #242324;
  --lg-line: rgba(255, 255, 255, 0.08);
  --lg-text: #f2f1f0;
  --lg-body: #c9c6c3;
  --lg-muted: #a6a3a1;
  --lg-teal-ink: #6fb8c0;
  --lg-teal-soft: rgba(77, 160, 169, 0.14);
}

/* ── сетка страницы ── */
html body section.nf-legal {
  display: grid !important;
  grid-template-columns: 260px minmax(0, 1fr);
  grid-template-areas:
    "hero hero"
    "nav  doc";
  gap: 32px 40px;
  max-width: 1140px;
  margin: 0 auto !important;
  padding: 48px 24px 96px !important;
  background: none !important;
}

/* ── заголовок ── */
html body .nf-legal .nf-legal-hero {
  grid-area: hero;
  position: relative;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  min-height: 0 !important;
}
html body .nf-legal .nf-legal-hero__bg,
html body .nf-legal .nf-legal-hero__icon { display: none !important; }
html body .nf-legal .nf-legal-hero__inner { display: block !important; max-width: none !important; margin: 0 !important; padding: 0 !important; }
html body .nf-legal .nf-legal-hero__title {
  margin: 0 0 10px !important;
  font-size: clamp(30px, 3.2vw, 42px) !important;
  font-weight: 700 !important;
  letter-spacing: -0.025em !important;
  line-height: 1.1 !important;
  color: var(--lg-text) !important;
}
html body .nf-legal .nf-legal-hero__sub { margin: 0 !important; max-width: 620px; font-size: 16px !important; line-height: 1.55 !important; color: var(--lg-muted) !important; }

/* ── меню документов (слева, закреплено) ── */
html body .nf-legal .nf-legal-tabs-outer {
  grid-area: nav;
  align-self: start;
  position: sticky;
  top: 112px;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
}
html body .nf-legal .nf-legal-tabs.nf-tabs-header {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  margin: 0 !important;
  padding: 6px !important;
  border: 1px solid var(--lg-line) !important;
  border-radius: 20px !important;
  background: var(--lg-card) !important;
  box-shadow: none !important;
  overflow: visible !important;
}
html body .nf-legal .nf-legal-tabs.nf-tabs-header::before,
html body .nf-legal .nf-legal-tabs.nf-tabs-header::after { display: none !important; }
html body .nf-legal .nf-legal-tab-btn.nf-tab-btn.nf-tab-btn {
  position: relative;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  width: 100% !important;
  height: auto !important;
  min-height: 48px !important;
  padding: 10px 14px !important;
  border: 0 !important;
  border-radius: 14px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--lg-muted) !important;
  font-size: 14.5px !important;
  font-weight: 600 !important;
  text-align: left !important;
  white-space: normal !important;
  line-height: 1.3 !important;
  transition: background-color 0.2s, color 0.2s !important;
}
html body .nf-legal .nf-legal-tab-btn.nf-tab-btn.nf-tab-btn::before,
html body .nf-legal .nf-legal-tab-btn.nf-tab-btn.nf-tab-btn::after { display: none !important; }
html body .nf-legal .nf-legal-tab-btn.nf-tab-btn.nf-tab-btn svg {
  flex: none;
  width: 34px !important;
  height: 34px !important;
  padding: 8px !important;
  border-radius: 10px !important;
  background: rgba(55, 53, 54, 0.05) !important;
  color: var(--lg-muted) !important;
  transition: background-color 0.2s, color 0.2s !important;
}
html[data-theme="dark"] body .nf-legal .nf-legal-tab-btn.nf-tab-btn.nf-tab-btn svg { background: rgba(255, 255, 255, 0.06) !important; }
html body .nf-legal .nf-legal-tab-btn.nf-tab-btn.nf-tab-btn:hover { background: rgba(55, 53, 54, 0.04) !important; color: var(--lg-text) !important; }
html[data-theme="dark"] body .nf-legal .nf-legal-tab-btn.nf-tab-btn.nf-tab-btn:hover { background: rgba(255, 255, 255, 0.04) !important; }
html body .nf-legal .nf-legal-tab-btn.nf-tab-btn.nf-tab-btn.nf-tab-btn-active {
  background: var(--lg-teal-soft) !important;
  color: var(--lg-text) !important;
}
html body .nf-legal .nf-legal-tab-btn.nf-tab-btn.nf-tab-btn.nf-tab-btn-active svg {
  background: var(--lg-teal) !important;
  color: #fff !important;
}

/* ── документ ── */
html body .nf-legal .nf-legal-panels { grid-area: doc; min-width: 0; margin: 0 !important; padding: 0 !important; }
html body .nf-legal .nf-legal-card {
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid var(--lg-line) !important;
  border-radius: 24px !important;
  background: var(--lg-card) !important;
  background-image: none !important;
  box-shadow: none !important;
  overflow: hidden;
}
html body .nf-legal .nf-legal-card__head {
  display: block !important;
  padding: 36px 44px 24px !important;
  margin: 0 !important;
  border-bottom: 1px solid var(--lg-line) !important;
  background: none !important;
}
html body .nf-legal .nf-legal-card__head-icon { display: none !important; }
html body .nf-legal .nf-legal-card__title {
  margin: 0 0 6px !important;
  font-size: 26px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  line-height: 1.2 !important;
  color: var(--lg-text) !important;
}
html body .nf-legal .nf-legal-card__meta { margin: 0 !important; font-size: 14.5px !important; color: var(--lg-muted) !important; }
html body .nf-legal .nf-legal-card__body { padding: 28px 44px 40px !important; counter-reset: lgsec; }

/* разделы: номер, обычный регистр, читаемый текст */
html body .nf-legal .nf-legal-section {
  position: relative;
  margin: 0 !important;
  padding: 0 0 0 52px !important;
  border: 0 !important;
  background: none !important;
  counter-increment: lgsec;
}
html body .nf-legal .nf-legal-section + .nf-legal-section { margin-top: 28px !important; }
html body .nf-legal .nf-legal-section::before {
  content: counter(lgsec, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--lg-teal-soft);
  color: var(--lg-teal-ink);
  font-size: 13px;
  font-weight: 700;
}
html body .nf-legal .nf-legal-section__title {
  margin: 6px 0 8px !important;
  font-size: 17px !important;
  font-weight: 650 !important;
  letter-spacing: -0.01em !important;
  text-transform: none !important;
  line-height: 1.35 !important;
  color: var(--lg-text) !important;
}
html body .nf-legal .nf-legal-section p {
  margin: 0 !important;
  max-width: 68ch;
  font-size: 15.5px !important;
  line-height: 1.75 !important;
  color: var(--lg-body) !important;
}

/* примечание */
html body .nf-legal .nf-legal-note {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  margin: 32px 0 0 !important;
  padding: 16px 18px !important;
  border: 0 !important;
  border-left: 3px solid var(--lg-teal) !important;
  border-radius: 0 !important;
  background: var(--lg-teal-soft) !important;
  color: var(--lg-text) !important;
  font-size: 14.5px !important;
  line-height: 1.6 !important;
  box-shadow: none !important;
}
html body .nf-legal .nf-legal-note svg { flex: none; margin-top: 2px; color: var(--lg-teal-ink) !important; }

/* реквизиты: строки «название — значение» */
html body .nf-legal .nf-legal-req-grid {
  display: block !important;
  margin: 0 !important;
  border: 1px solid var(--lg-line) !important;
  border-radius: 18px !important;
  overflow: hidden;
  background: none !important;
}
html body .nf-legal .nf-legal-req-item {
  display: grid !important;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 16px !important;
  align-items: baseline;
  margin: 0 !important;
  padding: 16px 20px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
}
html body .nf-legal .nf-legal-req-item + .nf-legal-req-item { border-top: 1px solid var(--lg-line) !important; }
html body .nf-legal .nf-legal-req-label {
  font-size: 13.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: var(--lg-muted) !important;
}
html body .nf-legal .nf-legal-req-value { font-size: 15.5px !important; font-weight: 500 !important; line-height: 1.5 !important; color: var(--lg-text) !important; }
html body .nf-legal .nf-legal-req-link { color: var(--lg-teal-ink) !important; text-decoration: none !important; border-bottom: 1px solid rgba(77, 160, 169, 0.35); }
html body .nf-legal .nf-legal-req-link:hover { border-bottom-color: currentColor; }

/* ── планшет и телефон ── */
@media (max-width: 900px) {
  html body section.nf-legal {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "hero" "nav" "doc";
    gap: 20px;
    padding: 28px 16px 72px !important;
  }
  html body .nf-legal .nf-legal-tabs-outer { position: static; }
  html body .nf-legal .nf-legal-tabs.nf-tabs-header {
    flex-direction: row !important;
    overflow-x: auto !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  html body .nf-legal .nf-legal-tabs.nf-tabs-header::-webkit-scrollbar { display: none; }
  html body .nf-legal .nf-legal-tab-btn.nf-tab-btn.nf-tab-btn { width: auto !important; flex: none; white-space: nowrap !important; min-height: 44px !important; padding: 6px 14px 6px 6px !important; }
  html body .nf-legal .nf-legal-tab-btn.nf-tab-btn.nf-tab-btn svg { width: 30px !important; height: 30px !important; padding: 7px !important; }
  html body .nf-legal .nf-legal-card__head { padding: 26px 22px 18px !important; }
  html body .nf-legal .nf-legal-card__title { font-size: 22px !important; }
  html body .nf-legal .nf-legal-card__body { padding: 22px 22px 28px !important; }
  html body .nf-legal .nf-legal-section { padding-left: 0 !important; }
  html body .nf-legal .nf-legal-section::before { position: static; display: grid; margin-bottom: 10px; }
  html body .nf-legal .nf-legal-req-item { grid-template-columns: minmax(0, 1fr); gap: 4px !important; }
}
html body .nf-legal .nf-legal-tab-btn.nf-tab-btn.nf-tab-btn > span { display: inline !important; font-size: inherit !important; }
