html { scrollbar-gutter: stable; }

/* ============================================================
   RSK ProLite — app.css
   Адаптация 320px → 3840px без множества @media.
   Использует clamp() для шрифтов и min() для контейнера.
   Загружается ПОСЛЕ styles.css → перекрывает конфликты.
   ============================================================ */

/* ---------- Универсальные токены ---------- */
:root {
  /* Адаптивный контейнер: 1280px на десктопе, но не более 100% - 40px */
  --content-w: min(1500px, 100% - 32px);
  --content-w-lg: min(1500px, 100% - 40px);

  /* Адаптивные отступы */
  --pad-x: clamp(12px, 2vw, 32px);
  --gap: 16px;
  --gap-lg: clamp(12px, 1.4vw, 20px);

  /* Адаптивные радиусы */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
}

/* ---------- Универсальный сброс конфликтов ---------- */
html { -webkit-text-size-adjust: 100%; }
*, *::before, *::after { box-sizing: border-box; }
img, svg { max-width: 100%; height: auto; display: block; }

body {
  margin: 0;
  /* База: 15px на мобильном, растёт до 17px на 4K */
  font-size: clamp(14px, 0.95vw + 8px, 17px);
  line-height: 1.5;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* ---------- Контейнер — центрируется, не растягивается ---------- */
.container,
main,
#app,
main#app {
  width: 100%;
  max-width: var(--content-w);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

/* На 4K мониторах (≥2400px) — чуть шире */
@media (min-width: 2400px) {
  .container, main, #app { max-width: var(--content-w-lg); }
}

/* ---------- Заголовки — адаптивные ---------- */
h1, .rs-hero h1, .s-h1 {
  font-size: clamp(20px, 2vw + 12px, 34px);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 clamp(4px, 0.5vw, 8px);
}
h2, .rs-samples-head h2 {
  font-size: clamp(17px, 1.4vw + 10px, 26px);
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 clamp(4px, 0.4vw, 8px);
}
h3 { font-size: clamp(15px, 1vw + 10px, 20px); line-height: 1.3; margin: 0 0 4px; }
h4 { font-size: clamp(13px, 0.6vw + 10px, 16px); line-height: 1.3; margin: 0 0 3px; }
p  { font-size: clamp(13px, 0.5vw + 10px, 15px); line-height: 1.5; margin: 0 0 8px; }

/* ============================================================
   HERO
   ============================================================ */
.rs-hero {
  text-align: center;
  padding: clamp(8px, 1vw, 20px) 0 clamp(6px, 0.6vw, 12px);
}
.rs-hero h1 {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.rs-hero p {
  font-size: clamp(12.5px, 0.6vw + 10px, 16px);
  color: var(--text-secondary, #475569);
  max-width: 640px;
  margin: 0 auto;
}

/* ============================================================
   BENTO GRID — 7 сценариев
   ============================================================ */
.rs-bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(165px, auto);
  gap: var(--gap);
  margin: clamp(8px, 1vw, 16px) 0 clamp(12px, 1.2vw, 20px);
}
.rs-bento-card {
  background: var(--bg-secondary, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--r-lg);
  padding: clamp(12px, 1vw, 20px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  position: relative;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}
.rs-bento-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent, #2563eb);
  box-shadow: 0 12px 32px rgba(37,99,235,0.10);
}
.rs-bento-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent, #2563eb);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.rs-bento-card:hover::before { transform: scaleX(1); }

.rs-bento-hero {
  grid-column: span 2;
  grid-row: span 2;
  padding: clamp(16px, 1.8vw, 28px);
  background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
}
.rs-bento-icon {
  width: clamp(36px, 3vw, 48px);
  height: clamp(36px, 3vw, 48px);
  border-radius: var(--r);
  background: rgba(37,99,235,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(18px, 1.4vw, 24px);
  flex-shrink: 0;
  line-height: 1;
}
.rs-bento-hero .rs-bento-icon {
  width: clamp(48px, 4.5vw, 68px);
  height: clamp(48px, 4.5vw, 68px);
  font-size: clamp(22px, 2vw, 32px);
  border-radius: var(--r-lg);
}
.rs-bento-card h3 {
  font-size: clamp(14px, 0.7vw + 10px, 17px);
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
  color: var(--text-primary, #0f172a);
}
.rs-bento-hero h3 {
  font-size: clamp(18px, 1.3vw + 12px, 26px);
  font-weight: 700;
  margin: 0 0 4px;
}
.rs-bento-card p {
  font-size: clamp(11.5px, 0.4vw + 10px, 13.5px);
  line-height: 1.4;
  color: var(--text-secondary, #475569);
  margin: 4px 0 0;
}
.rs-bento-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.rs-badge-pop {
  font-size: clamp(10px, 0.3vw + 9px, 12px);
  font-weight: 600;
  color: #16a34a;
  background: rgba(34,197,94,0.10);
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.rs-badge-pro {
  font-size: clamp(10px, 0.3vw + 9px, 12px);
  font-weight: 700;
  color: var(--accent, #2563eb);
  background: rgba(37,99,235,0.10);
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.5px;
}
.rs-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: clamp(8px, 0.8vw, 14px);
  padding: clamp(7px, 0.5vw, 10px) clamp(12px, 1vw, 18px);
  border-radius: var(--r);
  background: var(--accent, #2563eb);
  color: #fff;
  font-size: clamp(12px, 0.4vw + 10px, 14px);
  font-weight: 600;
  width: fit-content;
  text-decoration: none;
}
.rs-bento-hero:hover .rs-cta { background: #1d4ed8; }

/* Комплексный — 8-я карточка, нейтральный */
.rs-bento-complex { grid-column: span 2; }

/* ============================================================
   4 «ПОЧЕМУ МЫ» — 3 колонки, разные размеры
   ============================================================ */
.rs-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  margin: clamp(8px, 1vw, 16px) 0;
}
.rs-features > .rs-feature:nth-child(1),
.rs-features > .rs-feature:nth-child(4) { grid-column: span 2; }

.rs-feature {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: clamp(8px, 0.8vw, 16px);
  padding: clamp(12px, 1vw, 22px);
  background: var(--bg-secondary, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  position: relative;
  overflow: hidden;
  min-height: clamp(70px, 5vw, 110px);
}
.rs-feature:hover {
  transform: translateY(-3px);
  border-color: var(--accent, #2563eb);
  box-shadow: 0 10px 24px rgba(37,99,235,0.08);
}
.rs-fi {
  width: clamp(36px, 3vw, 56px);
  height: clamp(36px, 3vw, 56px);
  border-radius: var(--r);
  background: rgba(37,99,235,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(18px, 1.5vw, 28px);
  flex-shrink: 0;
  line-height: 1;
}
.rs-features > .rs-feature:nth-child(1) .rs-fi,
.rs-features > .rs-feature:nth-child(4) .rs-fi {
  width: clamp(44px, 4vw, 64px);
  height: clamp(44px, 4vw, 64px);
  font-size: clamp(22px, 1.8vw, 32px);
}
.rs-feature > div:last-child { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.rs-feature h4 {
  font-size: clamp(13px, 0.7vw + 10px, 18px);
  font-weight: 600;
  margin: 0;
  color: var(--text-primary, #0f172a);
}
.rs-feature p {
  font-size: clamp(11.5px, 0.4vw + 10px, 14px);
  color: var(--text-secondary, #475569);
  margin: 0;
  line-height: 1.4;
}

/* ============================================================
   3 ШАГА
   ============================================================ */
.rs-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  margin: clamp(8px, 1vw, 16px) 0;
}
.rs-steps > .rs-step:nth-child(1),
.rs-steps > .rs-step:nth-child(2) { grid-column: span 1; }
.rs-steps > .rs-step:nth-child(3) { grid-column: span 1; }

.rs-step {
  display: flex;
  align-items: center;
  gap: clamp(8px, 0.8vw, 16px);
  padding: clamp(12px, 1vw, 20px);
  background: var(--bg-secondary, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--r-lg);
  min-height: clamp(70px, 5vw, 90px);
}
.rs-num {
  width: clamp(36px, 3vw, 48px);
  height: clamp(36px, 3vw, 48px);
  border-radius: 50%;
  background: var(--accent, #2563eb);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(15px, 1vw, 20px);
  font-weight: 700;
  flex-shrink: 0;
}
.rs-step span {
  font-size: clamp(13px, 0.6vw + 10px, 16px);
  font-weight: 500;
  line-height: 1.3;
  color: var(--text-primary, #0f172a);
}

/* ============================================================
   ОБРАЗЦЫ РАБОТ
   ============================================================ */
.rs-samples { margin: clamp(12px, 1.2vw, 20px) 0; }
.rs-samples-head { margin-bottom: clamp(8px, 0.8vw, 14px); }
.rs-samples-head h2 {
  font-size: clamp(17px, 1.4vw + 10px, 24px);
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text-primary, #0f172a);
}
.rs-samples-head p {
  font-size: clamp(12.5px, 0.5vw + 10px, 15px);
  color: var(--text-secondary, #475569);
  margin: 0;
}
.rs-samples-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}
.rs-sample {
  display: flex;
  align-items: flex-start;
  gap: clamp(8px, 1vw, 16px);
  padding: clamp(16px, 1.2vw, 20px);
  background: var(--bg-secondary, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--r-lg);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  position: relative;
  overflow: hidden;
}
.rs-sample-wide { grid-column: span 2; }
.rs-sample:hover {
  transform: translateY(-3px);
  border-color: var(--accent, #2563eb);
  box-shadow: 0 10px 24px rgba(37,99,235,0.10);
}
.rs-sample-icon {
  width: clamp(36px, 3vw, 48px);
  height: clamp(36px, 3vw, 48px);
  border-radius: var(--r);
  background: rgba(37,99,235,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(18px, 1.5vw, 24px);
  flex-shrink: 0;
}
.rs-sample h3 {
  font-size: clamp(14px, 0.6vw + 10px, 17px);
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text-primary, #0f172a);
}
.rs-sample p {
  font-size: clamp(11.5px, 0.4vw + 10px, 13.5px);
  color: var(--text-secondary, #475569);
  margin: 0 0 8px;
  line-height: 1.4;
}
.rs-sample-link {
  font-size: clamp(11.5px, 0.4vw + 10px, 13px);
  font-weight: 600;
  color: var(--accent, #2563eb);
}

/* ============================================================
   СТАТЬИ
   ============================================================ */
.rs-articles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  margin: clamp(12px, 1.2vw, 20px) 0;
}
.rs-article {
  display: flex;
  flex-direction: column;
  padding: clamp(16px, 1.2vw, 22px);
  background: var(--bg-secondary, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  text-decoration: none;
  color: inherit;
  min-height: clamp(120px, 10vw, 170px);
}
.rs-article:hover {
  transform: translateY(-3px);
  border-color: var(--accent, #2563eb);
  box-shadow: 0 10px 24px rgba(37,99,235,0.08);
}
.rs-tag {
  display: inline-block;
  font-size: clamp(10px, 0.3vw + 9px, 12px);
  font-weight: 700;
  color: var(--accent, #2563eb);
  background: rgba(37,99,235,0.08);
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  width: fit-content;
}
.rs-article h3 {
  font-size: clamp(14px, 0.6vw + 10px, 18px);
  font-weight: 600;
  margin: 0 0 8px;
  line-height: 1.3;
  color: var(--text-primary, #0f172a);
}
.rs-article p {
  font-size: clamp(12px, 0.4vw + 10px, 14px);
  color: var(--text-secondary, #475569);
  margin: 0 0 8px;
  flex: 1;
  line-height: 1.4;
}
.rs-read {
  font-size: clamp(12px, 0.4vw + 10px, 13px);
  font-weight: 600;
  color: var(--accent, #2563eb);
  margin-top: auto;
}

/* ============================================================
   МОДАЛКА
   ============================================================ */
.rs-modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: clamp(8px, 2vw, 20px);
}
.rs-modal[style*="flex"] { display: flex !important; }
.rs-modal-box {
  background: var(--bg-secondary, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: min(560px, 100%);
  max-height: min(90vh, 800px);
  overflow-y: auto;
  padding: clamp(16px, 2vw, 28px);
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
}
.rs-modal-close {
  position: absolute;
  top: 12px; right: 12px;
  font-size: 24px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  border-radius: 8px;
}
.rs-modal-close:hover { background: var(--bg-primary, #f8fafc); color: var(--text-primary, #0f172a); }
.rs-modal-header { display: flex; align-items: center; gap: clamp(8px, 1vw, 14px); margin-bottom: clamp(16px, 1.5vw, 22px); }
.rs-modal-icon {
  width: clamp(44px, 4vw, 56px);
  height: clamp(44px, 4vw, 56px);
  border-radius: var(--r);
  background: rgba(37,99,235,0.08);
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(20px, 2vw, 28px);
  flex-shrink: 0;
}
.rs-modal-header h2 { font-size: clamp(17px, 1.2vw + 10px, 22px); margin: 0 0 2px; }
.rs-modal-header p  { font-size: clamp(12px, 0.4vw + 10px, 13.5px); margin: 0; color: var(--text-secondary, #475569); }
.rs-modal-section {
  margin-bottom: clamp(12px, 1.2vw, 20px);
  padding: clamp(12px, 1.2vw, 16px);
  background: var(--bg-primary, #f8fafc);
  border-radius: var(--r);
}
.rs-modal-section h3 { font-size: clamp(12.5px, 0.4vw + 10px, 14px); margin: 0 0 8px; }
.rs-modal-section ul { list-style: none; padding: 0; margin: 0; }
.rs-modal-section li {
  font-size: clamp(12px, 0.4vw + 10px, 13.5px);
  line-height: 1.5;
  padding: 5px 0;
  color: var(--text-secondary, #475569);
}
.rs-modal-section li b { color: var(--text-primary, #0f172a); }
.rs-verdict-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.rs-verdict {
  font-size: clamp(11.5px, 0.3vw + 10px, 12.5px);
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 8px;
  white-space: nowrap;
}
.rs-verdict.rs-green  { background: rgba(34,197,94,.12);  color: #16a34a; }
.rs-verdict.rs-yellow { background: rgba(234,179,8,.15);  color: #ca8a04; }
.rs-verdict.rs-red    { background: rgba(239,68,68,.12);  color: #dc2626; }
.rs-modal-price { font-size: clamp(12.5px, 0.4vw + 10px, 14px); color: var(--text-secondary, #475569); margin: 0 0 8px; }
.rs-modal-price b { color: var(--text-primary, #0f172a); font-size: clamp(16px, 1vw + 10px, 20px); }
.rs-modal-footer {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.rs-modal-footer > button { flex: 1 1 auto; min-width: 120px; }
.rs-modal-btn-primary,
.rs-modal-btn-sample,
.rs-modal-btn-secondary {
  padding: clamp(9px, 0.7vw, 12px) clamp(14px, 1vw, 22px);
  border-radius: var(--r);
  font-size: clamp(12.5px, 0.4vw + 10px, 14px);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, border-color .15s, color .15s;
  border: 1px solid transparent;
}
.rs-modal-btn-primary { background: var(--accent, #2563eb); color: #fff; border-color: var(--accent, #2563eb); }
.rs-modal-btn-primary:not(:disabled):hover { background: #1d4ed8; border-color: #1d4ed8; }
.rs-modal-btn-sample { background: transparent; color: var(--accent, #2563eb); border-color: var(--accent, #2563eb); }
.rs-modal-btn-sample:not(:disabled):hover { background: rgba(37,99,235,0.08); }
.rs-modal-btn-secondary { background: transparent; color: var(--text-secondary, #475569); border-color: var(--border-color, #e2e8f0); }
.rs-modal-btn-secondary:hover { border-color: var(--accent, #2563eb); color: var(--accent, #2563eb); }
.rs-modal-btn-primary:disabled,
.rs-modal-btn-sample:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
   ТЁМНАЯ ТЕМА
   ============================================================ */
body.dark .rs-bento-card,
body.dark .rs-feature,
body.dark .rs-step,
body.dark .rs-article,
body.dark .rs-sample {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
body.dark .rs-bento-hero { background: linear-gradient(135deg, #1e293b 0%, #1a2740 100%); }
body.dark .rs-bento-icon,
body.dark .rs-fi,
body.dark .rs-sample-icon,
body.dark .rs-modal-icon { background: rgba(59,130,246,0.18); }
body.dark .rs-bento-card h3,
body.dark .rs-bento-hero h3,
body.dark .rs-feature h4,
body.dark .rs-step span,
body.dark .rs-article h3,
body.dark .rs-sample h3 { color: #e2e8f0; }
body.dark .rs-bento-card p,
body.dark .rs-feature p,
body.dark .rs-article p,
body.dark .rs-sample p { color: #94a3b8; }
body.dark .rs-modal-box { background: #1e293b; border-color: #334155; }
body.dark .rs-modal-section { background: #0f172a; }

/* ============================================================
   АДАПТАЦИЯ — мобильный (<700px)
   ============================================================ */
@media (max-width: 700px) {
  .container, main, #app { padding-left: 12px; padding-right: 12px; }

  .rs-bento {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: auto;
    gap: 8px;
  }
  .rs-bento-hero { grid-column: span 2; grid-row: span 1; }
  .rs-bento-complex { grid-column: span 2; }
  .rs-bento-card { padding: 12px; min-height: 96px; }

  .rs-features { grid-template-columns: 1fr; gap: 8px; }
  .rs-features > .rs-feature:nth-child(1),
  .rs-features > .rs-feature:nth-child(4) { grid-column: span 1; }
  .rs-feature { padding: 12px 14px; min-height: 0; }

  .rs-steps { grid-template-columns: 1fr; gap: 8px; }
  .rs-step { padding: 8px 12px; min-height: 0; }

  .rs-samples-grid { grid-template-columns: 1fr; gap: 8px; }
  .rs-sample-wide { grid-column: span 1; }
  .rs-sample { padding: 12px 14px; }

  .rs-articles { grid-template-columns: 1fr; gap: 8px; }
  .rs-article { min-height: 0; padding: 16px 16px; }

  .rs-modal { padding: 8px; }
  .rs-modal-box { padding: 16px; max-height: 94vh; }
  .rs-modal-footer { flex-direction: column; }
  .rs-modal-footer > button { width: 100%; }
}

/* ============================================================
   ПЛАНШЕТ (700-1100px)
   ============================================================ */
@media (min-width: 701px) and (max-width: 1100px) {
  .rs-bento { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rs-bento-hero { grid-column: span 2; grid-row: span 2; }
  .rs-bento-complex { grid-column: span 3; }
  .rs-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rs-features > .rs-feature:nth-child(1),
  .rs-features > .rs-feature:nth-child(4) { grid-column: span 1; }
  .rs-samples-grid { grid-template-columns: 1fr; }
  .rs-sample-wide { grid-column: span 1; }
}

/* ============================================================
   ОЧЕНЬ МАЛЕНЬКИЙ ЭКРАН (<380px)
   ============================================================ */
@media (max-width: 380px) {
  .rs-bento { grid-template-columns: 1fr; }
  .rs-bento-hero, .rs-bento-complex { grid-column: span 1; }
}


/* ============================================================
   BADGE FIX — не обрезается
   ============================================================ */
.rs-bento-top {
  overflow: visible !important;
  min-width: 0 !important;
}
.rs-badge-pop,
.rs-badge-pro {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  max-width: none !important;
}
.rs-bento-card {
  overflow: visible !important;
}
.rs-bento-card::before {
  border-radius: 16px 16px 0 0 !important;
}

/* На 4K — увеличенные отступы */
@media (min-width: 2400px) {
  .rs-bento { gap: 20px !important; }
  .rs-features { gap: 20px !important; }
  .rs-steps { gap: 20px !important; }
  .rs-articles { gap: 20px !important; }
  .rs-samples-grid { gap: 20px !important; }
}


/* ============================================================
   LAYOUT v3 — меню слева, контент шире
   ============================================================ */

header {
  width: 100% !important;
  max-width: 100% !important;
  padding: 8px 0 !important;
}
header .container,
header .header-inner {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 24px !important;
  max-width: 100% !important;
  width: 100% !important;
  padding-left: clamp(24px, 3vw, 56px) !important;
  padding-right: clamp(24px, 3vw, 56px) !important;
  margin: 0 auto !important;
}
header .logo { flex: 0 0 auto !important; margin: 0 !important; }
header nav {
  flex: 0 0 auto !important;
  display: flex !important;
  margin: 0 !important;
  order: 0 !important;
}
header .nav-menu {
  display: flex !important;
  flex-direction: row !important;
  gap: clamp(12px, 1.4vw, 24px) !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
}
header .nav-menu li { margin: 0 !important; padding: 0 !important; }
header .nav-menu a { font-size: 14px !important; white-space: nowrap !important; }
header .header-actions {
  margin-left: auto !important;
  flex: 0 0 auto !important;
  display: flex !important;
  gap: 8px !important;
  align-items: center !important;
}

main,
main#app,
#app.container,
main.container {
  max-width: min(1700px, 100% - 40px) !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding-left: clamp(24px, 3vw, 56px) !important;
  padding-right: clamp(24px, 3vw, 56px) !important;
}
@media (min-width: 2200px) {
  main, main#app, #app.container, main.container {
    max-width: min(2100px, 100% - 80px) !important;
  }
}

footer {
  padding: 8px 0 !important;
  margin: 16px 0 0 0 !important;
  width: 100% !important;
}
footer .container,
footer .footer-inner {
  max-width: min(1700px, 100% - 40px) !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 0 clamp(24px, 3vw, 56px) !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 16px !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
}

.rs-bento-hero {
  background: var(--bg-primary) !important;
}
body.dark .rs-bento-hero {
  background: #1e293b !important;
}

/* ============================================================
   MOBILE HEADER v3
   ============================================================ */
@media (max-width: 900px) {
  header { padding: 8px 0 !important; }
  header .container,
  header .header-inner {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 0 12px !important;
  }
  header .logo { order: 1 !important; font-size: 15px !important; }
  header .header-actions {
    order: 2 !important;
    margin-left: auto !important;
    gap: 4px !important;
  }
  header .header-actions > * {
    height: 28px !important;
    min-height: 28px !important;
    min-width: 28px !important;
    padding: 0 8px !important;
    font-size: 11px !important;
    border-radius: 6px !important;
  }
  header #designToggle,
  header .btn-design {
    font-size: 10px !important;
    padding: 0 8px !important;
    height: 28px !important;
  }
  header .lang-display {
    height: 28px !important;
    min-width: 34px !important;
    padding: 0 8px !important;
    font-size: 11px !important;
  }
  header nav {
    flex: 0 0 100% !important;
    order: 3 !important;
    width: 100% !important;
    margin: 4px 0 0 0 !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }
  header nav::-webkit-scrollbar { display: none !important; }
  header .nav-menu {
    width: max-content !important;
    gap: 4px !important;
    justify-content: flex-start !important;
  }
  header .nav-menu a {
    font-size: 12px !important;
    padding: 4px 8px !important;
  }
  main, main#app, #app.container, main.container {
    max-width: 100% !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  footer .container, footer .footer-inner {
    flex-direction: column !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 0 12px !important;
    gap: 8px !important;
  }
}


/* ============================================================
   FOOTER — 3 зоны: копирайт | баннер | ссылки
   ============================================================ */

.footer-inner,
footer > .container,
footer .container {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 20px !important;
  max-width: min(1700px, 100% - 40px) !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 0 clamp(24px, 3vw, 60px) !important;
  box-sizing: border-box !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
  background: transparent !important;
  border: none !important;
}




body.dark footer { background: #1e293b !important; border-color: #334155 !important; }

/* ============================================================
   Мобильный — подвал в столбик, всё по центру
   ============================================================ */
@media (max-width: 900px) {
  .footer-inner,
  footer > .container,
  footer .container {
    flex-direction: column !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 8px !important;
    padding: 0 12px !important;
    max-width: 100% !important;
  }
}


/* ============================================================
   FULLWIDTH MODULES v2 — жёсткий
   ============================================================ */
main#app {
  max-width: min(1700px, 100% - 40px) !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding-left: clamp(24px, 3vw, 60px) !important;
  padding-right: clamp(24px, 3vw, 60px) !important;
  box-sizing: border-box !important;
}

/* Прямые дети — на всю ширину */
main#app > div,
main#app > section,
main#app > article,
main#app > * {
  max-width: 100% !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
}

/* Второй уровень (после вложенных div-обёрток) */
main#app > div > div,
main#app > div > section {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* ============================================================
   FOOTER FORCE — копирайт точно виден
   ============================================================ */
footer .footer-inner,
footer > .container,
footer .container {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 20px !important;
  max-width: min(1700px, 100% - 40px) !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 0 clamp(24px, 3vw, 60px) !important;
  box-sizing: border-box !important;
  font-size: 13px !important;
  background: transparent !important;
  border: none !important;
  visibility: visible !important;
  opacity: 1 !important;
}

body.dark footer .footer-copy { color: #e2e8f0 !important; }



/* ============================================================
   МОБИЛЬНЫЙ — всё в столбик
   ============================================================ */
@media (max-width: 900px) {
  main#app {
    padding-left: 12px !important;
    padding-right: 12px !important;
    max-width: 100% !important;
  }
  footer .footer-inner,
  footer > .container,
  footer .container {
    flex-direction: column !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 8px !important;
    padding: 12px !important;
    max-width: 100% !important;
  }
  footer
  footer
  footer
  footer
}


/* ============================================================
   GLOBALFOOTER ID — жёсткий, неломаемый
   ============================================================ */
html { scrollbar-gutter: stable !important; }

#globalFooter {
  display: block !important;
  width: 100% !important;
  background: #0f172a !important;
  color: #94a3b8 !important;
  border-top: none !important;
  padding: clamp(32px, 3vw, 48px) 0 clamp(20px, 2vw, 28px) !important;
  margin: 48px 0 0 0 !important;
  box-sizing: border-box !important;
  position: static !important;
  font-family: inherit !important;
}
#globalFooter > div {
  display: block !important;
  max-width: min(1700px, 100% - 40px) !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 0 clamp(24px, 3vw, 60px) !important;
  box-sizing: border-box !important;
}
#globalFooter > div > div:nth-child(1) {
  flex: 0 0 auto !important;
  font-weight: 600 !important;
  color: var(--text-primary) !important;
  font-size: 13px !important;
  white-space: nowrap !important;
}
#globalFooter > div > div:nth-child(2) {
  flex: 1 1 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  color: #64748b !important;
  font-size: 12px !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
#globalFooter > div > div:nth-child(3) {
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  white-space: nowrap !important;
}
#globalFooter a {
  color: #475569 !important;
  text-decoration: none !important;
  font-size: 13px !important;
}
#globalFooter a:hover { color: #2563eb !important; }

@media (max-width: 900px) {
  #globalFooter > div {
    flex-direction: column !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 8px !important;
    padding: 0 12px !important;
    max-width: 100% !important;
  }
  #globalFooter > div > div:nth-child(1) { order: 2 !important; }
  #globalFooter > div > div:nth-child(2) { order: 3 !important; white-space: normal !important; font-size: 11px !important; }
  #globalFooter > div > div:nth-child(3) { order: 1 !important; flex-wrap: wrap !important; justify-content: center !important; gap: 8px !important; }
  #globalFooter a { font-size: 12px !important; }
}


/* ============================================================
   NOFLEX FINAL — footer всегда под контентом, не растягивается
   ============================================================ */
html, body {
  display: block !important;
  min-height: 0 !important;
  height: auto !important;
}
body {
  margin: 0 !important;
  padding: 0 !important;
}
main, #app, main#app {
  display: block !important;
  flex: none !important;
  min-height: 0 !important;
}
#globalFooter {
  margin-top: 24px !important;
  position: relative !important;
}


/* ============================================================
   STICKY FOOTER — подвал прижат к низу экрана
   ============================================================ */

/* html + body — на всю высоту */
html {
  height: 100% !important;
  min-height: 100% !important;
}

body {
  min-height: 100vh !important;
  min-height: 100dvh !important; /* мобильные — с учётом UI */
  display: block !important;
  
  margin: 0 !important;
}

/* header — фиксированной высоты */
body > header {
  flex: 0 0 auto !important;
}

/* main — растягивается, забирает всё свободное место */
body > main,
body > #app,
body > main#app {
  flex: 1 0 auto !important;
  display: block !important;
}

/* footer — прижимается к низу */
body > footer {
  flex: 0 0 auto !important;
  margin-top: auto !important;
}

/* Модалки и оверлеи — position: fixed, вне flex-потока */
body > .modal-overlay,
body > .rs-modal,
body > [id$="Modal"] {
  flex: 0 0 auto !important;
}


/* ============================================================
   MODULE 1A — Единый дизайн кнопок + компактные модалки
   Загружается поверх, безопасно. Только CSS.
   ============================================================ */

/* --- ВСЕ кнопки в модуле — единый дизайн --- */
.contract-header button,
.toolbar button,
.actions button,
button.btn:not(.rs-modal-btn-primary):not(.rs-modal-btn-secondary):not(.rs-modal-btn-sample),
.module-contract button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 16px !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px !important;
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  transition: border-color .15s, color .15s, background .15s !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
}
.contract-header button:hover,
.toolbar button:hover,
.actions button:hover,
button.btn:not(.rs-modal-btn-primary):not(.rs-modal-btn-secondary):not(.rs-modal-btn-sample):hover,
.module-contract button:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}
.contract-header button.primary,
.toolbar button.primary,
.actions button.primary {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}
.contract-header button.primary:hover,
.toolbar button.primary:hover,
.actions button.primary:hover {
  background: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
  color: #fff !important;
}
.contract-header button.danger,
.toolbar button.danger,
.actions button.danger {
  color: var(--red) !important;
}
.contract-header button.danger:hover,
.toolbar button.danger:hover,
.actions button.danger:hover {
  border-color: var(--red) !important;
  color: var(--red) !important;
}
.contract-header button.active,
.toolbar button.active {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}

/* Иконки внутри кнопок */
.contract-header button svg,
.toolbar button svg,
.actions button svg {
  width: 14px !important;
  height: 14px !important;
  flex: 0 0 auto !important;
}

/* --- Шапка модуля: заголовок слева, кнопки справа --- */
.contract-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
  padding: 8px 16px !important;
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 12px !important;
  margin-bottom: 8px !important;
}
.contract-header .actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-left: auto !important;
  flex-wrap: wrap !important;
}

/* ── Sticky header + главный ряд + бейдж типа (2026-10-17) ── */
/* [2026-10-17] sticky снят — был конфликт с hero */
.contract-header .header-main {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}
.contract-header .header-main .primary {
  font-weight: 600 !important;
  padding: 0 14px !important;
}
.contract-header .type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(37,99,235,0.10);
  color: var(--accent);
  border: 1px solid rgba(37,99,235,0.25);
  white-space: nowrap;
}
.contract-header .type-badge:empty { display: none !important; }

/* --- Toolbar: вкладки и действия — единая строка --- */
.toolbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
  padding: 8px 0 !important;
  border-bottom: 1px solid var(--border-color) !important;
  margin-bottom: 12px !important;
}
.toolbar .tabs {
  display: flex !important;
  gap: 8px !important;
  align-items: center !important;
}
.toolbar .actions {
  display: flex !important;
  gap: 8px !important;
  align-items: center !important;
  margin-left: auto !important;
}

/* --- Модалки: компактные, по ширине контента --- */
.contract-editor-modal,
#saveAsModal .modal-box,
#myDocsModal .modal-box,
.modal-box {
  max-width: 520px !important;
  width: 100% !important;
  padding: 24px 24px !important;
  border-radius: 14px !important;
  box-sizing: border-box !important;
}
/* Кнопки внутри модалки — в столбик на всю ширину */
#saveAsModal .modal-box button,
#myDocsModal .modal-box button {
  width: 100% !important;
  justify-content: center !important;
  height: 40px !important;
  font-size: 14px !important;
  margin-bottom: 8px !important;
}
#saveAsModal .modal-box button:last-child,
#myDocsModal .modal-box button:last-child {
  margin-bottom: 0 !important;
}

/* --- Мобильный --- */
@media (max-width: 700px) {
  .contract-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  .contract-header .actions {
    margin-left: 0 !important;
    justify-content: flex-start !important;
    width: 100% !important;
  }
  .contract-header button {
    height: 32px !important;
    padding: 0 8px !important;
    font-size: 12px !important;
  }
  .toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .toolbar .actions {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .modal-box {
    max-width: 95% !important;
    padding: 16px !important;
  }
}


/* ============================================================
   CONTRACT — прямые кнопки, type-grid в модалке
   ============================================================ */
.contract-header {
  display: flex !important; align-items: center !important;
  gap: 8px !important; flex-wrap: wrap !important;
  padding: 8px 14px !important;
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 12px !important;
  margin-bottom: 8px !important;
}
.contract-header button {
  border-radius: 8px !important;
  height: 34px !important; min-height: 34px !important;
  padding: 0 16px !important;
  font-size: 13px !important; font-weight: 500 !important;
  border: 1px solid var(--border-color) !important;
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  cursor: pointer !important; font-family: inherit !important;
  display: inline-flex !important; align-items: center !important; gap: 8px !important;
  transition: border-color .15s, color .15s !important;
  white-space: nowrap !important; line-height: 1 !important;
  box-sizing: border-box !important;
}
.contract-header button:hover { border-color: var(--accent) !important; color: var(--accent) !important; }
.contract-header button.danger { color: var(--red) !important; }
.contract-header button.danger:hover { border-color: var(--red) !important; }
#selectTypeBtn {
  background: var(--accent) !important; color: #fff !important; border-color: var(--accent) !important;
}
#selectTypeBtn:hover { background: #1d4ed8 !important; color: #fff !important; border-color: #1d4ed8 !important; }
.contract-header .actions { margin-left: auto !important; display: flex !important; gap: 8px !important; flex-wrap: wrap !important; }

/* Модалка typePicker */
#typePickerModal .modal-box { max-width: 720px !important; padding: 24px !important; border-radius: 14px !important; }
#typePickerModal h2 { font-size: 22px !important; font-weight: 700 !important; margin: 0 0 8px !important; text-align: center !important; }
#typePickerModal p { font-size: 14px !important; text-align: center !important; color: var(--text-secondary) !important; }
.modal-close {
  position: absolute !important; top: 12px !important; right: 16px !important;
  font-size: 24px !important; width: 36px !important; height: 36px !important;
  border: none !important; background: none !important; color: var(--text-muted) !important;
  cursor: pointer !important; border-radius: 8px !important; line-height: 1 !important;
}
.modal-close:hover { background: var(--bg-primary) !important; color: var(--text-primary) !important; }
.type-grid { display: grid !important; grid-template-columns: repeat(5, minmax(0,1fr)) !important; gap: 12px !important; margin-top: 16px !important; }
.type-card {
  display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: center !important;
  gap: 8px !important; padding: 16px 10px !important;
  background: var(--bg-primary) !important; border: 1px solid var(--border-color) !important;
  border-radius: 12px !important; cursor: pointer !important; text-align: center !important;
  transition: transform .15s, border-color .15s, box-shadow .15s !important;
  min-height: 100px !important;
}
.type-card:hover { transform: translateY(-3px) !important; border-color: var(--accent) !important; box-shadow: 0 8px 20px rgba(37,99,235,0.10) !important; }
.type-card-icon { font-size: 28px !important; line-height: 1 !important; }
.type-card-title { font-size: 13px !important; font-weight: 600 !important; color: var(--text-primary) !important; }
body.dark .type-card { background: #0f172a !important; border-color: #334155 !important; }

/* Textarea */
#docContent {
  width: 100% !important; min-height: 420px !important; padding: 16px !important;
  font-family: 'Courier New', monospace !important; font-size: 15px !important; line-height: 1.6 !important;
  border: 1px solid var(--border-color) !important; border-radius: 12px !important;
  background: var(--bg-primary) !important; color: var(--text-primary) !important; resize: vertical !important;
}

@media (max-width: 900px) {
  .contract-header { flex-direction: column !important; align-items: stretch !important; }
  .contract-header .actions { margin-left: 0 !important; width: 100% !important; }
  .contract-header button { height: 32px !important; padding: 0 8px !important; font-size: 12px !important; }
  .type-grid { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
  #typePickerModal .modal-box { padding: 16px !important; }
}

/* ============================================================
   DRAG-AND-DROP DND — перетаскивание файла в редактор
   ============================================================ */
.editor-area { position: relative; }
.editor-area textarea.dnd-over {
  border-color: var(--accent, #2563eb) !important;
  background: rgba(37, 99, 235, 0.06) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18) !important;
}
.editor-area:has(textarea.dnd-over)::before {
  content: 'Отпустите файл — содержимое загрузится в редактор';
  position: absolute;
  inset: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--accent, #2563eb);
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent, #2563eb);
  font-weight: 500;
  font-size: 14px;
  pointer-events: none;
  z-index: 5;
}
body.dark .editor-area:has(textarea.dnd-over)::before {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border-color: #3b82f6;
}
body.dark .editor-area textarea.dnd-over {
  background: rgba(59, 130, 246, 0.12) !important;
}

/* ============================================================
   STAGE B UI — dropdown + try-sample + help block
   ============================================================ */
.contract-type-select {
  height: 34px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%2364748b' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  min-width: 190px;
}
.contract-type-select:hover { border-color: var(--accent); color: var(--accent); }
.contract-type-select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
body.dark .contract-type-select { background-color: var(--text-secondary); color: #e2e8f0; }
body.dark .contract-type-select option,
body.dark .contract-type-select optgroup { background: #1e293b; color: #e2e8f0; }

#trySampleBtn {
  white-space: nowrap;
}

.contract-help {
  margin-top: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}
.contract-help > summary {
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-input);
  user-select: none;
  list-style: none;
  position: relative;
  padding-left: 40px;
}
.contract-help > summary::-webkit-details-marker { display: none; }
.contract-help > summary::before {
  content: '▸';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  transition: transform .2s;
  font-size: 12px;
  color: var(--text-muted);
}
.contract-help[open] > summary::before { transform: translateY(-50%) rotate(90deg); }
.contract-help > summary:hover { color: var(--accent); }

.contract-help-body {
  padding: 16px 20px 20px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.contract-help-body h4 {
  margin: 16px 0 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}
.contract-help-body h4:first-child { margin-top: 0; }
.contract-help-body p { margin: 0 0 12px; }
.contract-help-body ul { margin: 8px 0 0; padding-left: 20px; }
.contract-help-body ul li { margin-bottom: 8px; }
.contract-help-body strong { color: var(--text-primary); font-weight: 500; }

body.dark .contract-help { background: #1e293b; border-color: #334155; }
body.dark .contract-help > summary { background: #0f172a; color: #e2e8f0; }
body.dark .contract-help-body { color: #94a3b8; }
body.dark .contract-help-body h4,
body.dark .contract-help-body strong { color: #e2e8f0; }

@media (max-width: 700px) {
  .contract-type-select { min-width: 0; flex: 1; font-size: 12px; }
  #trySampleBtn { font-size: 12px; padding: 0 8px; }
}

/* ============================================================
   STAGE C UI — пункты договора (EXCLUDE-модель)
   ============================================================ */
.contract-clauses {
  margin-top: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}
.contract-clauses > summary {
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-input);
  user-select: none;
  list-style: none;
  position: relative;
  padding-left: 40px;
}
.contract-clauses > summary::-webkit-details-marker { display: none; }
.contract-clauses > summary::before {
  content: '▸';
  position: absolute;
  left: 16px; top: 50%;
  transform: translateY(-50%);
  transition: transform .2s;
  font-size: 12px;
  color: var(--text-muted);
}
.contract-clauses[open] > summary::before { transform: translateY(-50%) rotate(90deg); }
.contract-clauses > summary:hover { color: var(--accent); }

.contract-clauses-body {
  padding: 12px 20px 16px;
  font-size: 14px;
}
.clauses-hint {
  margin: 0 0 12px;
  color: var(--text-secondary);
  font-size: 13px;
}
.clauses-list {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 8px;
}
.clause-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  color: var(--text-primary);
  transition: background .15s;
}
.clause-item:hover { background: var(--bg-input); }
.clause-item input[type=checkbox] {
  width: 16px; height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.clause-num { color: var(--text-muted); font-weight: 500; min-width: 22px; }
.clause-title { flex: 1; }
.clause-item input:not(:checked) ~ .clause-title {
  color: var(--text-muted);
  text-decoration: line-through;
}
.clauses-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.clauses-actions button {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}
body.dark .contract-clauses { background: #1e293b; border-color: #334155; }
body.dark .contract-clauses > summary { background: #0f172a; color: #e2e8f0; }
body.dark .clause-item { color: #e2e8f0; }
body.dark .clause-item:hover { background: #0f172a; }
body.dark .clauses-hint { color: #94a3b8; }

/* ============================================================
   VALIDATION UI — проверка данных в реальном времени
   ============================================================ */
.contract-validation {
  margin-top: 16px;
  padding: 12px 16px;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 12px;
}
.validation-title {
  font-weight: 500;
  font-size: 14px;
  color: #92400e;
  margin-bottom: 8px;
}
.validation-issues {
  display: grid;
  gap: 4px;
}
.validation-item {
  font-size: 14px;
  color: #78350f;
  padding: 4px 0;
}
body.dark .contract-validation {
  background: #422006;
  border-color: #b45309;
}
body.dark .validation-title { color: #fcd34d; }
body.dark .validation-item { color: #fde68a; }

/* ============================================================
   PARTY TYPE UI — выбор типа сторон договора
   ============================================================ */
.party-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.party-card {
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-input);
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s, transform .1s;
}
.party-card:hover {
  border-color: var(--accent);
  background: var(--bg-secondary);
}
.party-card:active { transform: scale(.98); }
.party-icon { font-size: 22px; margin-bottom: 8px; }
.party-title { font-weight: 500; font-size: 14px; color: var(--text-primary); margin-bottom: 4px; }
.party-sub { font-size: 12px; color: var(--text-muted); }
body.dark .party-card { background: #0f172a; border-color: #334155; }
body.dark .party-card:hover { background: #1e293b; border-color: #3b82f6; }
body.dark .party-title { color: #e2e8f0; }
body.dark .party-sub { color: #94a3b8; }
@media (max-width: 600px) {
  .party-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   HEADER ЭТАЛОН — светлая шапка с поиском, языками, кнопками
   ============================================================ */
header {
  background: var(--bg-primary) !important;
  border-bottom: 1px solid #e2e8f0 !important;
  height: 60px !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
}
header .header-inner {
  display: flex !important;
  align-items: center !important;
  gap: 24px !important;
  height: 60px !important;
  max-width: min(1700px, 100% - 40px) !important;
  margin: 0 auto !important;
  padding: 0 clamp(16px, 2vw, 40px) !important;
}
header .logo {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  text-decoration: none !important;
  letter-spacing: -0.5px !important;
}
header .logo span { color: #14b8a6 !important; }
header .logo-shield { width: 26px; height: 30px; flex-shrink: 0; }
header nav { flex: 1 1 auto; }
header nav .nav-menu {
  display: flex !important;
  gap: 24px !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
header nav .nav-menu a {
  color: #475569 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  transition: color .15s !important;
  white-space: nowrap !important;
}
header nav .nav-menu a:hover { color: #14b8a6 !important; }
header .header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}
header .search { position: relative !important; display: inline-block !important; }
header .search::before {
  content: '🔍' !important;
  position: absolute !important;
  left: 10px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  font-size: 13px !important;
  pointer-events: none !important;
  opacity: 0.5 !important;
  z-index: 1 !important;
}
header .search input {
  height: 34px !important;
  padding: 0 16px 0 32px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-family: inherit !important;
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  width: 180px !important;
  outline: none !important;
}
header .search input:focus { border-color: #14b8a6 !important; background: var(--bg-primary) !important; }
header .lang-select {
  height: 34px !important;
  padding: 0 8px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  background: var(--bg-primary) !important;
  color: #475569 !important;
  font-size: 13px !important;
  font-family: inherit !important;
  cursor: pointer !important;
}
header .btn-mydocs,
header .btn-login {
  height: 34px !important;
  padding: 0 16px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  background: var(--bg-primary) !important;
  color: #475569 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  font-family: inherit !important;
  cursor: pointer !important;
  transition: all .15s !important;
}
header .btn-mydocs:hover,
header .btn-login:hover {
  border-color: #14b8a6 !important;
  color: #14b8a6 !important;
}/* [REMOVED] правило, скрывавшее .theme-toggle (app.v2.css) */

/* Адаптив */
@media (max-width: 1000px) {
  header .search input { width: 120px !important; }
  header nav .nav-menu { gap: 16px !important; }
  header nav .nav-menu a { font-size: 13px !important; }
}
@media (max-width: 700px) {
  header .header-inner { flex-wrap: wrap !important; height: auto !important; padding: 8px 12px !important; }
  header .search { order: 3 !important; width: 100% !important; }
  header .search input { width: 100% !important; }
  header nav { order: 4 !important; width: 100% !important; overflow-x: auto !important; }
}

/* ============================================================
   ETALON STYLES — CSS из site-bento.html (главная + подвал + всё)
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-secondary);
    line-height: 1.5;
    min-height: 100vh;
  }
  .container { max-width: 1360px; margin: 0 auto; padding: 0 24px; }


  /* ═══ ПРОГРЕСС-БАР ВВЕРХУ ═══ */
  .progress-bar {
    position: fixed; top: 0; left: 0;
    height: 3px; width: 0%;
    background: linear-gradient(90deg, #14b8a6, #5eead4);
    z-index: 9999;
    transition: width .1s linear;
    box-shadow: 0 0 12px rgba(20,184,166,0.6);
  }

  /* ═══ ШАПКА ═══ */
  header {
    background: var(--bg-primary);
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 0;
    position: sticky; top: 0; z-index: 200;
  }
  .header-inner { display: flex; align-items: center; gap: 20px; }
.logo {
    display: flex; align-items: center; gap: 8px;
    font-size: 19px; font-weight: 800; color: var(--text-primary);
    text-decoration: none; letter-spacing: -0.3px;
  }
  .logo-shield {
    width: 24px; height: 28px; flex-shrink: 0;
  }
  .logo span { color: #14b8a6; }
  .lang-select {
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: var(--bg-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #0f766e;
    cursor: pointer;
    outline: none;
    transition: border-color .2s;
  }
  .lang-select:hover { border-color: #14b8a6; }
  .lang-select:focus { border-color: #14b8a6; box-shadow: 0 0 0 3px rgba(20,184,166,0.12); }
  nav ul { display: flex; list-style: none; gap: 20px; }
  nav a { color: #475569; text-decoration: none; font-size: 14px; font-weight: 500; transition: color .2s; }
  nav a:hover { color: #14b8a6; }
  .header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
  .search { position: relative; width: 220px; }
  .search input {
    width: 100%; padding: 8px 12px 8px 34px;
    border: 1px solid #e2e8f0; border-radius: 10px;
    background: var(--bg-secondary); font-family: inherit; font-size: 13px;
    color: var(--text-secondary); outline: none; transition: all .2s;
  }
  .search input:focus { border-color: #14b8a6; background: var(--bg-primary); box-shadow: 0 0 0 3px rgba(20,184,166,0.12); }
  .search::before {
    content: '🔍'; position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
    font-size: 12px; opacity: 0.5;
  }
  .btn-mydocs {
    padding: 8px 14px; border-radius: 10px; border: 1px solid #e2e8f0;
    background: var(--bg-primary); font-size: 13px; font-weight: 500; cursor: pointer;
    color: #475569; font-family: inherit; transition: all .2s;
  }
  .btn-mydocs:hover { border-color: #14b8a6; color: #0f766e; }
  .btn-login {
    padding: 8px 18px; border-radius: 10px; border: none;
    background: #14b8a6; color: #fff; font-size: 13px; font-weight: 600;
    cursor: pointer; font-family: inherit;
    box-shadow: 0 4px 12px rgba(20,184,166,0.30);
    transition: all .2s;
  }
  .btn-login:hover { background: #0d9488; transform: translateY(-1px); }


  /* ═══ ХЛЕБНЫЕ КРОШКИ ═══ */
  .breadcrumbs {
    font-size: 13px;
    color: #64748b;
    padding: 16px 0 8px;
    display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap;
  }
  .breadcrumbs a {
    color: #14b8a6; text-decoration: none; font-weight: 500;
    transition: color .2s;
  }
  .breadcrumbs a:hover { color: #0f766e; }
  .breadcrumb-sep { color: #cbd5e1; font-size: 14px; }
  .breadcrumb-current { color: #475569; font-weight: 500; }

  /* ═══ HERO ═══ */
  .hero { padding: 56px 0 40px; }
  .hero-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 48px;
    align-items: center;
  }
  .hero-content { text-align: left; }
  .hero h1 {
    font-size: clamp(30px, 4vw, 48px); font-weight: 700; margin-bottom: 16px;
    color: var(--text-primary); line-height: 1.1; letter-spacing: -1px;
  }
  .hero-visual {
    display: flex; justify-content: center; align-items: center;
    position: relative;
  }
  .hero-shield-big {
    width: clamp(180px, 22vw, 280px);
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(20,184,166,0.35))
            drop-shadow(0 0 80px rgba(20,184,166,0.20));
    animation: heroFloat 6s ease-in-out infinite;
  }
  .hero-shield-big svg { width: 100%; height: auto; }
  @keyframes heroFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-12px) rotate(-2deg); }
  }
  .hero h1 .accent { color: #0f766e; }
  .hero p { font-size: 16px; color: #475569; max-width: 680px; margin: 0 auto 24px; }
  .hero-cta { display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: flex-start; margin-bottom: 20px; }
  .btn-hero-primary {
    padding: 15px 32px;
    font-size: 16px;
    box-shadow: 0 8px 24px rgba(20,184,166,0.45);
  }
  .btn-hero-primary:hover {
    box-shadow: 0 12px 32px rgba(20,184,166,0.55);
  }
  .btn-hero-secondary {
    padding: 15px 28px;
    font-size: 15px;
    background: transparent;
    color: #64748b;
    border-color: #cbd5e1;
  }
  .btn-hero-secondary:hover {
    background: var(--bg-secondary);
    border-color: #94a3b8;
    color: #475569;
  }
  .btn-primary {
    padding: 12px 26px; border-radius: 12px; border: none;
    background: #14b8a6; color: #fff; font-size: 15px; font-weight: 600;
    cursor: pointer; font-family: inherit;
    box-shadow: 0 6px 18px rgba(20,184,166,0.35);
    transition: all .2s;
  }
  .btn-primary:hover { background: #0d9488; transform: translateY(-2px); box-shadow: 0 10px 26px rgba(20,184,166,0.45); }
  .btn-secondary {
    padding: 12px 26px; border-radius: 12px;
    background: var(--bg-primary); color: #0f766e; border: 1.5px solid #14b8a6;
    font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit;
    transition: all .2s;
  }
  .btn-secondary:hover { background: #f0fdfa; }
  .hero-badges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
  .hero-badges span {
    font-size: 13px; padding: 8px 14px; border-radius: 30px; font-weight: 500;
    background: var(--bg-primary); color: #0f766e;
    border: 1px solid rgba(20,184,166,0.30);
  }

  /* ═══ СЕКЦИИ ═══ */
  .section {
    background: var(--bg-secondary);
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 32px 32px;
    margin: 28px 0;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .7s ease, transform .7s ease;
  }
  .section.in-view {
    opacity: 1;
    transform: translateY(0);
  }
  .section-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 24px; padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
    flex-wrap: wrap; gap: 12px;
  }
  .section-title { font-size: 22px; font-weight: 700; color: var(--text-secondary); }
  .section-title-main { font-size: 28px; color: #0f766e; letter-spacing: -0.4px; }
  .section-link { font-size: 14px; color: #14b8a6; text-decoration: none; font-weight: 600; }
  .section-link:hover { color: #0f766e; }

  /* ═══════════════════════════════════════════
     BENTO — 4 колонки, иерархия 2×2 / 2×1 / 1×1
     ═══════════════════════════════════════════ */
  .bento {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 165px;
    gap: 16px;
  }
  .b-lg { grid-column: span 2; grid-row: span 2; }
  .b-md { grid-column: span 2; }

  /* ─── Базовая карточка ─── */
  .card {
    background: var(--bg-primary);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    box-shadow: 0 3px 12px rgba(15,23,42,0.06);
    transition: all .25s cubic-bezier(.2,.8,.2,1);
    overflow: hidden;
    min-height: 0;
  }
  .card:hover {
    border-color: #14b8a6;
    box-shadow: 0 10px 28px rgba(20,184,166,0.18);
    transform: translateY(-3px);
  }
  /* Модули с бейджами — 2px рамка */
  .card-featured {
    border: 2px solid rgba(20,184,166,0.45);
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  }
  .card-featured:hover {
    border-color: #14b8a6;
    box-shadow: 0 12px 32px rgba(20,184,166,0.22);
  }

  /* Верхняя часть карточки */
  .card-top { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
  .card-icon {
    width: 38px; height: 38px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-primary);
    border: 1.5px solid #e2e8f0;
    flex-shrink: 0;
    transition: border-color .25s, transform .25s;
  }
  .card:hover .card-icon {
    border-color: rgba(20,184,166,0.40);
    transform: scale(1.05);
  }
  .card h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.25;
    margin: 0;
  }
  .card p {
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Нижняя часть — цена + статья */
  .card-bottom {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
  }
  .card-price {
    font-size: 12px;
    color: #64748b;
    line-height: 1.2;
  }
  .card-price b {
    font-size: 16px;
    color: #0f766e;
    font-weight: 700;
  }
  .card-article-link {
    font-size: 11px;
    color: #14b8a6;
    font-weight: 600;
    text-decoration: none;
    display: block;
    line-height: 1.25;
    /* Однострочный, с обрезкой */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color .2s;
  }
  .card-article-link:hover { color: #0f766e; }

  /* Бейдж в углу */
  .card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 3px 8px;
    border-radius: 20px;
    background: #14b8a6;
    color: #fff;
  }

  /* ═══ Главная карточка b-lg (2×2) — бирюзовый градиент ═══ */
  .card.b-lg {
    padding: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdfa 60%, #ccfbf1 100%);
    border: 1.5px solid rgba(20,184,166,0.30);
  }
  .card.b-lg:hover {
    border-color: #14b8a6;
    box-shadow: 0 14px 36px rgba(20,184,166,0.25);
  }
  .card.b-lg .card-icon {
    background: rgba(255,255,255,0.9);
    border-color: rgba(20,184,166,0.30);
  }
  .card.b-lg .card-icon { width: 44px; height: 44px; font-size: 21px; border-radius: 11px; }
  .card.b-lg h3 { font-size: 19px; line-height: 1.2; }
  .card.b-lg p { font-size: 13px; -webkit-line-clamp: 3; }
  .card.b-lg .card-bottom { margin-top: 16px; padding-top: 12px; gap: 8px; }
  .card.b-lg .card-price { font-size: 13px; }
  .card.b-lg .card-price b { font-size: 21px; }
  .card.b-lg .card-article-link { font-size: 12px; }

  /* Буллеты внутри b-lg */
  .card-bullets {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: grid;
    gap: 4px;
  }
  .card-bullets li {
    font-size: 13px;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .card-bullets li::before {
    content: '✓';
    color: #14b8a6;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
  }

  /* ═══════════════════════════════════════════
     РОТАЦИЯ — тот же фон, что у секций
     ═══════════════════════════════════════════ */
  .rotator-section {
    background: var(--bg-secondary);
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 32px 32px;
    margin: 28px 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .7s ease, transform .7s ease;
  }
  .rotator-section.in-view { opacity: 1; transform: translateY(0); }
  .rotator-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
  }
  .rotator-sub {
    text-align: center;
    color: #64748b;
    font-size: 13px;
    margin-bottom: 24px;
  }
  .rotator { position: relative; height: 130px; }
  .rotator-slide {
    position: absolute; top: 0; left: 0; right: 0;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .5s ease, transform .5s ease;
    pointer-events: none;
  }
  .rotator-slide.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .rotator-inner {
    background: var(--bg-primary);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px 22px;
    display: flex;
    gap: 20px;
    align-items: center;
    box-shadow: 0 3px 12px rgba(15,23,42,0.06);
  }
  .rotator-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: #f0fdfa;
    border: 1.5px solid rgba(20,184,166,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
  }
  .rotator-content { flex: 1; min-width: 0; }
  .rotator-content h3 { font-size: 19px; font-weight: 700; color: var(--text-primary); margin-bottom: 5px; }
  .rotator-content p { font-size: 14px; color: #475569; margin-bottom: 4px; }
  .rotator-price { font-size: 13px; color: #64748b; }
  .rotator-price b { font-size: 17px; color: #0f766e; font-weight: 700; }
  .rotator-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .rotator-btn {
    padding: 8px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: all .2s;
  }
  .rotator-btn-primary {
    background: #14b8a6;
    color: #fff;
    border: none;
    box-shadow: 0 4px 14px rgba(20,184,166,0.35);
  }
  .rotator-btn-primary:hover { background: #0d9488; }
  .rotator-btn-secondary {
    background: transparent;
    color: #0f766e;
    border: 1.5px solid #14b8a6;
  }
  .rotator-btn-secondary:hover { background: #f0fdfa; }
  .rotator-dots { display: flex; gap: 8px; justify-content: center; margin-top: 20px; }
  .rotator-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: #cbd5e1; cursor: pointer; border: none; padding: 0;
    transition: all .3s;
  }
  .rotator-dot.active { background: #14b8a6; width: 26px; border-radius: 5px; }
  .rotator-dot:hover { background: #94a3b8; }
  .rotator-dot.active:hover { background: #0d9488; }

  /* ═══ ПРЕИМУЩЕСТВА ═══ */
  .features-2x2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .feature {
    background: var(--bg-primary);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    box-shadow: 0 3px 12px rgba(15,23,42,0.06);
    transition: all .25s;
  }
  .feature:hover {
    border-color: #14b8a6;
    box-shadow: 0 10px 28px rgba(20,184,166,0.15);
    transform: translateY(-3px);
  }
  .feature-icon {
    flex-shrink: 0;
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    background: #f0fdfa;
    border: 1px solid rgba(20,184,166,0.20);
  }
  .feature h4 { font-size: 17px; font-weight: 600; margin-bottom: 5px; color: var(--text-primary); }
  .feature p { font-size: 14px; color: #475569; }



  /* ═══ ДЕМОНСТРАЦИЯ ═══ */
  .demo-preview {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 32px;
    align-items: center;
  }
  .demo-screen {
    background: var(--bg-primary);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(15,23,42,0.12);
  }
  .demo-screen-bar {
    background: #f1f5f9;
    padding: 8px 14px;
    display: flex; gap: 8px;
    border-bottom: 1px solid #e2e8f0;
  }
  .demo-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: #cbd5e1;
  }
  .demo-dot:nth-child(1) { background: #fca5a5; }
  .demo-dot:nth-child(2) { background: #fcd34d; }
  .demo-dot:nth-child(3) { background: #86efac; }
  .demo-screen-body { padding: 20px 22px; }
  .demo-screen-header {
    display: flex; align-items: center; gap: 12px;
    padding-bottom: 16px; border-bottom: 1px solid #f1f5f9;
    margin-bottom: 16px;
  }
  .demo-screen-icon {
    width: 42px; height: 42px; border-radius: 10px;
    background: #f0fdfa; border: 1px solid rgba(20,184,166,0.20);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
  }
  .demo-screen-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
  .demo-screen-sub { font-size: 12px; color: #64748b; margin-top: 2px; }
  .demo-screen-content {
    display: flex; flex-direction: column; gap: 8px;
    margin-bottom: 16px;
  }
  .demo-line {
    font-size: 13px; padding: 8px 10px; border-radius: 8px;
    border-left: 3px solid; line-height: 1.45;
    display: flex; gap: 8px; align-items: flex-start;
    opacity: 0;
    transform: translateX(-8px);
    animation: demoSlide .5s ease forwards;
  }
  .demo-line-risk { animation-delay: 0.3s; }
  .demo-line-warn { animation-delay: 0.8s; }
  .demo-line-ok   { animation-delay: 1.3s; }
  .demo-screen-result {
    opacity: 0;
    animation: demoSlide .5s ease forwards;
    animation-delay: 1.8s;
  }
  @keyframes demoSlide {
    to { opacity: 1; transform: translateX(0); }
  }
  @keyframes demoPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
  }
  .demo-flag {
    animation: demoPulse 1.5s ease-in-out infinite;
    display: inline-block;
  }
  .demo-line-risk { background: #fef2f2; border-left-color: #ef4444; color: #7f1d1d; }
  .demo-line-warn { background: #fffbeb; border-left-color: #f59e0b; color: #78350f; }
  .demo-line-ok   { background: #f0fdf4; border-left-color: #22c55e; color: #14532d; }
  .demo-hl { background: rgba(255,255,255,0.7); padding: 1px 4px; border-radius: 3px; font-weight: 600; }
  .demo-screen-result {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 8px; padding-top: 16px; border-top: 1px solid #f1f5f9;
  }
  .demo-screen-stat {
    text-align: center;
    padding: 8px 4px;
  }
  .demo-stat-num {
    font-size: 22px; font-weight: 800; color: #14b8a6;
    line-height: 1;
  }
  .demo-stat-label {
    font-size: 10px; color: #64748b; margin-top: 4px;
    text-transform: uppercase; letter-spacing: 0.3px;
  }
  .demo-text h3 {
    font-size: 22px; font-weight: 700; color: var(--text-primary);
    margin-bottom: 12px; line-height: 1.2;
  }
  .demo-text p {
    font-size: 15px; color: #475569; line-height: 1.6;
    margin-bottom: 16px;
  }
  .demo-list {
    list-style: none; margin-bottom: 24px;
    display: flex; flex-direction: column; gap: 8px;
  }
  .demo-list li {
    font-size: 14px; color: #475569;
    display: flex; align-items: center; gap: 8px;
  }
  .demo-list li::before {
    content: '✓'; color: #14b8a6; font-weight: 700;
    font-size: 13px; flex-shrink: 0;
  }
  .demo-btn { padding: 12px 26px; }

  /* ═══ ВАРИАЦИИ ФОНОВ ═══ */
  .section-cases {
    background: #f0fdfa;
    border-color: rgba(20,184,166,0.20);
  }
  .section-demo {
    background: var(--bg-primary);
    border: 2px solid rgba(20,184,166,0.30);
  }

  /* ═══ КЕЙСЫ ═══ */
  .cases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .case {
    background: var(--bg-primary);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px;
    display: flex; flex-direction: column; gap: 16px;
    box-shadow: 0 3px 12px rgba(15,23,42,0.06);
    transition: all .25s;
  }
  .case:hover {
    border-color: #14b8a6;
    box-shadow: 0 10px 28px rgba(20,184,166,0.15);
    transform: translateY(-3px);
  }
  .case-header {
    display: flex; justify-content: space-between; align-items: baseline;
    padding-bottom: 12px; border-bottom: 1px solid #f1f5f9;
    gap: 12px; flex-wrap: wrap;
  }
  .case-type {
    font-size: 15px; font-weight: 700; color: var(--text-primary);
  }
  .case-amount {
    display: flex; flex-direction: column; align-items: flex-end;
    gap: 2px;
  }
  .case-amount span {
    font-size: 10px; text-transform: uppercase;
    letter-spacing: 0.6px; color: #94a3b8; font-weight: 700;
  }
  .case-amount strong {
    font-size: 22px; color: #0f766e; font-weight: 800;
    line-height: 1; letter-spacing: -0.5px;
  }
  .case-body { display: block;  gap: 12px; }
  .case-label {
    font-size: 11px; text-transform: uppercase;
    letter-spacing: 0.5px; font-weight: 700;
    color: #94a3b8; margin-bottom: 4px;
  }
  .case-before p {
    font-size: 13px; color: #475569; line-height: 1.5;
    font-style: italic;
  }
  .case-after p {
    font-size: 13px; color: #475569; line-height: 1.5;
  }
  .case-result {
    padding: 8px 12px; border-radius: 8px;
    background: #f0fdfa; border: 1px solid rgba(20,184,166,0.20);
    font-size: 13px; color: #0f766e; line-height: 1.45;
    margin-top: auto;
  }
  .case-result strong { color: #0f766e; font-weight: 700; }

  /* ═══ ОТЗЫВЫ ═══ */
  .reviews { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .review {
    background: var(--bg-primary);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 3px 12px rgba(15,23,42,0.06);
    transition: all .25s;
  }
  .review:hover {
    border-color: #14b8a6;
    box-shadow: 0 10px 28px rgba(20,184,166,0.15);
    transform: translateY(-3px);
  }
  .review-stars {
    color: #f59e0b; font-size: 16px;
    letter-spacing: 2px; line-height: 1;
    margin-bottom: -4px;
  }
  .review-text {
    font-size: 15px;
    color: #475569;
    line-height: 1.55;
    font-style: italic;
    flex: 1;
  }
  .review-text::before { content: '«'; color: #14b8a6; font-size: 18px; font-weight: 700; }
  .review-text::after { content: '»'; color: #14b8a6; font-size: 18px; font-weight: 700; }
  .review-author {
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
  }
  .review-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }
  .review-role { font-size: 13px; color: #64748b; }

  /* ═══ ШАГИ ═══ */
  .steps-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .step {
    background: var(--bg-primary);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    box-shadow: 0 3px 12px rgba(15,23,42,0.06);
    transition: all .25s;
  }
  .step:hover {
    border-color: #14b8a6;
    box-shadow: 0 10px 28px rgba(20,184,166,0.15);
    transform: translateY(-3px);
  }
  .step-num {
    flex-shrink: 0;
    width: 42px; height: 42px; border-radius: 50%;
    background: #14b8a6; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700;
    box-shadow: 0 4px 14px rgba(20,184,166,0.30);
  }
  .step h4 { font-size: 16px; font-weight: 600; margin-bottom: 5px; color: var(--text-primary); }
  .step p { font-size: 14px; color: #475569; }

  /* ═══ CTA ═══ */
  .cta-light {
    background: var(--bg-primary);
    border: 2px solid #14b8a6;
    border-radius: 20px;
    padding: 48px 40px;
    text-align: center;
    margin: 28px 0;
    box-shadow: 0 8px 32px rgba(20,184,166,0.12);
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .7s ease, transform .7s ease, box-shadow .3s;
  }
  .cta-light.in-view { opacity: 1; transform: translateY(0); }
  .cta-light.in-view:hover { transform: translateY(-3px); box-shadow: 0 12px 40px rgba(20,184,166,0.20); }
  .cta-light:hover { box-shadow: 0 12px 40px rgba(20,184,166,0.20); transform: translateY(-3px); }
  .cta-light h2 {
    color: var(--text-primary);
    font-size: clamp(22px, 2.4vw, 30px);
    font-weight: 700;
    margin-bottom: 8px;
  }
  .cta-light p { color: #475569; font-size: 15px; margin-bottom: 24px; }
  .cta-light .cta-buttons { display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

  /* ═══ ПОДВАЛ ═══ */
  footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 48px 0 24px;
    margin-top: 40px;
  }
  .footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr 1.4fr;
    gap: 28px;
    margin-bottom: 32px;
  }
  .footer-logo-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
  }
  .footer-shield {
    width: 38px;
    height: 44px;
    filter: drop-shadow(0 0 12px rgba(20,184,166,0.5));
    animation: shieldPulse 3s ease-in-out infinite;
  }
  @keyframes shieldPulse {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(20,184,166,0.4)); }
    50%      { filter: drop-shadow(0 0 18px rgba(94,234,212,0.7)); }
  }
  .footer-brand h3 { color: #5eead4; font-size: 20px; margin: 0; letter-spacing: -0.3px; }
  .footer-brand h3 span { color: #14b8a6; }
  .footer-brand p {
    font-size: 13px;
    line-height: 1.6;
    color: #94a3b8;
  }
  .footer-col h4 {
    color: #5eead4;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
  }
  .footer-col ul { list-style: none; }
  .footer-col li { margin-bottom: 8px; }
  .footer-col a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    transition: color .2s;
  }
  .footer-col a:hover { color: #5eead4; }
  .footer-coop-col .footer-coop-text {
    font-size: 13px;
    line-height: 1.55;
    color: #94a3b8;
    margin-bottom: 8px;
  }
  .footer-coop-col .footer-coop-btn {
    color: #14b8a6;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: color .2s;
  }
  .footer-coop-col .footer-coop-btn:hover { color: #5eead4; }

  .footer-socials {
    display: flex; flex-direction: column; gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #1e293b;
  }
  .social-link {
    display: inline-flex; align-items: center; gap: 8px;
    color: #94a3b8; font-size: 13px; font-weight: 500;
    text-decoration: none;
    transition: color .2s;
  }
  .social-link svg { flex-shrink: 0; }
  .social-link:hover { color: #5eead4; }

  .footer-bottom {
    border-top: 1px solid #1e293b;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
  }
  .footer-lock { color: #14b8a6; }

  /* ═══ АДАПТИВ ═══ */
  @media (max-width: 1000px) {
    .hero-grid { grid-template-columns: 1fr; gap: 32px; }
    .hero-content { text-align: center; }
    .hero-cta { justify-content: center; }
    .hero-visual { order: -1; }
    .hero-shield-big { width: 160px; }
    .bento { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 165px; }
    .b-lg { grid-column: span 2; grid-row: span 2; }
    .b-md { grid-column: span 2; }
    .features-2x2 { grid-template-columns: 1fr; }
    .steps-strip { grid-template-columns: 1fr; }
    .reviews { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    nav { display: none; }
    .search { width: 160px; }
    .rotator-inner { flex-direction: column; text-align: center; }
    .rotator-actions { flex-direction: row; justify-content: center; }
    .rotator { height: auto; }
    .rotator-slide { position: relative; }
  }
  @media (max-width: 600px) {
    .bento { grid-template-columns: 1fr; grid-auto-rows: auto; }
    .b-lg, .b-md { grid-column: auto; grid-row: auto; }
    .footer-grid { grid-template-columns: 1fr; }
    .search { display: none; }
    .rotator-actions { flex-direction: column; width: 100%; }
    .rotator-btn { width: 100%; }
  }

/* ============================================================
   SETTINGS-BLOCK — единый блок настроек договора
   ============================================================ */
.settings-block {
  margin-top: 16px;
  padding: 16px 20px;
  background: var(--bg-primary);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}
.settings-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 12px;
}
.settings-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}
.settings-block .contract-clauses {
  margin: 0;
  border: none;
  background: transparent;
}
.settings-block .contract-clauses > summary {
  background: transparent;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}
.settings-block .contract-clauses > summary::before {
  display: none;
}
.settings-block .contract-clauses-body {
  padding: 4px 0 0;
}
.clauses-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.clauses-actions button {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
}


/* [WHITE-FIX] Гарантия видимости #app */
#app {
  min-height: 50vh;
}
#app.page-leave {
  opacity: 0.01;
  transition: opacity 0.1s ease-out;
}
#app.page-enter,
#app:not(.page-leave):not(.page-enter) {
  opacity: 1;
  transition: opacity 0.2s ease-in;
}
/* Failsafe: если что-то пойдёт не так, body не чёрный и не белый пустой */
body {
  background: var(--bg-primary);
}


/* [PAGE-LEAVE-SAFE] Page-leave не должен гасить экран — только лёгкий сдвиг.
   Даже если класс залипнет, контент останется видимым. */
#app {
  min-height: 50vh;
}
#app.page-leave {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
#app.page-enter {
  opacity: 1 !important;
  visibility: visible !important;
}
/* Если старые стили где-то прятали #app — принудительно показываем */
main#app.container {
  display: block !important;
  opacity: 1;
}


/* [SECTION-VISIBLE-FIX] Даже если in-view не навесился — секции видны.
   Это устраняет пустое место между hero и footer. */
main#app > section,
main#app section {
  opacity: 1 !important;
  visibility: visible !important;
}
main#app section.in-view {
  opacity: 1 !important;
  transform: none !important;
}


/* [SECTION-VISIBLE-FIX] Даже если in-view не навесился — секции видны. */
main#app > section,
main#app section {
  opacity: 1 !important;
  visibility: visible !important;
}
main#app section.in-view {
  opacity: 1 !important;
  transform: none !important;
}


/* [CARDS-BENTO-FIX] Иконка слева + больший шрифт + статья в карточке */
.bento .card-top {
  display: grid !important;
  grid-template-columns: 44px 1fr !important;
  column-gap: 12px !important;
  row-gap: 4px !important;
  align-items: start !important;
}
.bento .card-top .card-icon {
  grid-column: 1 !important;
  grid-row: 1 / span 20 !important;
}
.bento .card-top > h3,
.bento .card-top > p,
.bento .card-top > ul {
  grid-column: 2 !important;
}
.bento .card-top > h3 {
  font-size: 19px !important;
  line-height: 1.25 !important;
  margin: 0 !important;
}
.bento .card-top > p {
  font-size: 15px !important;
  line-height: 1.45 !important;
  margin: 0 !important;
}
.bento .card-top > ul.card-bullets li {
  font-size: 14px !important;
  line-height: 1.5 !important;
}
.bento .card-icon {
  width: 44px !important;
  height: 44px !important;
}
.bento .card-icon svg {
  width: 22px !important;
  height: 22px !important;
}

/* Двухстрочная статья в карточке */
.bento .card-article-link {
  display: block !important;
  line-height: 1.35 !important;
  text-align: left !important;
}
.bento .card-article-title {
  display: block !important;
  font-weight: 500 !important;
  color: #0f766e !important;
  font-size: 14px !important;
}
.bento .card-article-sub {
  display: block !important;
  font-size: 12px !important;
  color: #64748b !important;
  margin-top: 1px !important;
  font-weight: 400 !important;
}
.bento .card-article-link:hover .card-article-title {
  color: #5eead4 !important;
  text-decoration: underline !important;
}


/* [CARDS-ICONS-TOP-RESTORE] Возврат иконок сверху + компактные статьи */
/* Иконка сверху, как было */
.bento .card-top {
  display: block !important;
  grid-template-columns: none !important;
}
.bento .card-top .card-icon {
  grid-column: auto !important;
  grid-row: auto !important;
  display: inline-flex !important;
  margin-bottom: 8px !important;
  width: 40px !important;
  height: 40px !important;
}
.bento .card-top > h3,
.bento .card-top > p,
.bento .card-top > ul {
  grid-column: auto !important;
}
.bento .card-icon svg {
  width: 20px !important;
  height: 20px !important;
}

/* Статьи — компактно, в границах карточки */
.bento .card-bottom {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  overflow: hidden !important;
}
.bento .card-article-link {
  display: block !important;
  overflow: hidden !important;
  max-width: 100% !important;
  line-height: 1.3 !important;
  text-decoration: none !important;
  padding: 8px 8px !important;
  border-radius: 6px !important;
  background: #f0fdfa !important;
  transition: background 0.15s !important;
}
.bento .card-article-link:hover {
  background: #ccfbf1 !important;
}
.bento .card-article-title {
  display: block !important;
  font-weight: 500 !important;
  color: #0f766e !important;
  font-size: 13px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.bento .card-article-sub {
  display: block !important;
  font-size: 12px !important;
  color: #64748b !important;
  margin-top: 2px !important;
  font-weight: 400 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* АДАПТИВ: мобильный */
@media (max-width: 767px) {
  .bento {
    grid-template-columns: 1fr !important;
  }
  .bento .card {
    min-height: auto !important;
  }
  .bento .card-top > h3 {
    font-size: 17px !important;
  }
  .bento .card-top > p {
    font-size: 14px !important;
  }
  .bento .card-article-title {
    font-size: 12px !important;
  }
  .bento .card-article-sub {
    font-size: 11px !important;
  }
}

/* АДАПТИВ: очень узкий (320-374) */
@media (max-width: 374px) {
  .bento .card-top > h3 {
    font-size: 16px !important;
  }
  .bento .card-article-title {
    white-space: normal !important;
    font-size: 12px !important;
  }
}

/* ═══ [PATCH 2026-10-02] Симметрия шапки + тёмная тема ═══ */
header,
body > header {
  padding: 9px 0 !important;
  height: auto !important;
  min-height: 56px !important;
}
@media (max-width: 767px) {
  header, body > header { padding: 8px 0 !important; min-height: 52px !important; }
}

html.dark,
html[data-theme="dark"],
body.dark {
  background: #0f172a !important;
  color: #e2e8f0 !important;
}
body.dark header {
  background: #1e293b !important;
  border-bottom-color: #334155 !important;
}
body.dark footer {
  background: #0a0f1e !important;
}
body.dark .rs-bento-card,
body.dark .rs-feature,
body.dark .rs-step,
body.dark .rs-article,
body.dark .rs-sample,
body.dark .demo-screen {
  background: #1e293b !important;
  border-color: #334155 !important;
}



/* Общее: одинаковая сетка внутри карточек */
.bento > .card {
  display: flex !important;
  flex-direction: column !important;
}
.bento > .card .card-top {
  flex: 0 0 auto !important;
}
.bento > .card .card-bottom {
  margin-top: auto !important;
}
/* ══════════════════════════════════════════════════════════════
   [PATCH 2026-10-03-7] Карточка b-lg: иконка слева, контент справа на всю ширину
   ══════════════════════════════════════════════════════════════ */

/* card-top — 2 колонки через grid */
.card.b-lg .card-top,
.bento > .card.b-lg .card-top {
  display: grid !important;
  grid-template-columns: 44px minmax(0, 1fr) !important;
  grid-template-areas:
    "icon title"
    "icon desc"
    "icon bullets" !important;
  column-gap: 12px !important;
  row-gap: 4px !important;
  align-items: start !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  flex-direction: initial !important;
}

/* Иконка — только 40×40, без абсолютного позиционирования */
.card.b-lg .card-top > .card-icon,
.bento > .card.b-lg .card-top > .card-icon {
  grid-area: icon !important;
  position: static !important;
  top: auto !important;
  left: auto !important;
  margin: 0 !important;
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  flex: none !important;
  align-self: start !important;
  justify-self: start !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 20px !important;
}

/* Заголовок, описание, список — каждая в свою строку, на всю ширину правой колонки */
.card.b-lg .card-top > h3,
.bento > .card.b-lg .card-top > h3 {
  grid-area: title !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  white-space: normal !important;
}

.card.b-lg .card-top > p,
.bento > .card.b-lg .card-top > p {
  grid-area: desc !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 13px !important;
  color: #64748b !important;
  line-height: 1.4 !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.card.b-lg .card-top > ul,
.card.b-lg .card-top > .card-bullets,
.bento > .card.b-lg .card-top > ul {
  grid-area: bullets !important;
  display: block !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 8px 0 0 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  column-count: auto !important;
  columns: auto !important;
  column-width: auto !important;
}

.card.b-lg .card-top > ul > li,
.card.b-lg .card-top > .card-bullets > li {
  display: block !important;
  position: relative !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  padding: 0 0 0 20px !important;
  margin: 0 0 5px 0 !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
}

.card.b-lg .card-top > ul > li::before,
.card.b-lg .card-top > .card-bullets > li::before {
  content: '✓' !important;
  color: #14b8a6 !important;
  font-weight: 700 !important;
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  width: 16px !important;
  text-align: left !important;
}

/* card-bottom — цена слева, ссылка справа */
.card.b-lg .card-bottom,
.bento > .card.b-lg .card-bottom {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 12px !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
  margin-top: 12px !important;
  padding-top: 8px !important;
  border-top: 1px solid #e2e8f0 !important;
}

.card.b-lg .card-bottom > .card-price,
.card.b-lg .card-price {
  order: 1 !important;
  flex: 0 0 auto !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: var(--text-primary) !important;
  margin: 0 !important;
  white-space: nowrap !important;
}

.card.b-lg .card-price b {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
}

.card.b-lg .card-bottom > .card-article-link,
.card.b-lg .card-article-link {
  order: 2 !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
  font-size: 13px !important;
  color: #0f766e !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}

/* ═══════════════════════════════════════════════════════════════
   [BOOTSTRAP-ICONS-STYLE] Единый стиль иконок
   Все иконки наследуют цвет, размер по контексту.
   ═══════════════════════════════════════════════════════════════ */
.bi {
  display: inline-block;
  vertical-align: -0.125em;
  line-height: 1;
  color: inherit;
}

/* Карточки bento — иконка в квадрате .card-icon */
.bento .card-icon {
  color: var(--accent, #14b8a6);
}
.bento .card-icon .bi {
  font-size: 24px;
  display: block;
  line-height: 1;
}
.bento > .card.b-lg > .card-top > .card-icon .bi {
  font-size: 28px;
}

/* Hero */
.hero .bi,
.rs-hero .bi {
  color: var(--accent, #14b8a6);
  font-size: 40px;
}

/* Кнопки — иконка мелкая, слева от текста */
.btn .bi,
.btn-primary .bi,
.btn-secondary .bi,
.btn-hero-primary .bi,
.btn-hero-secondary .bi {
  font-size: 16px;
  vertical-align: -0.15em;
  margin-right: 4px;
}

/* CTA-блок */
.cta-light .bi {
  color: var(--accent, #14b8a6);
  font-size: 20px;
  vertical-align: -0.15em;
}

/* Feature-блок (Почему мы) */
.feature .feature-icon {
  color: var(--accent, #14b8a6);
}
.feature .feature-icon .bi {
  font-size: 26px;
  display: block;
  line-height: 1;
}

/* Step-нумератор */
.step .step-num {
  font-family: inherit;
}

/* Ссылки-статьи в карточках */
.card-article-link .bi {
  font-size: 12px;
  vertical-align: -0.1em;
  margin-right: 2px;
  color: var(--accent, #14b8a6);
}

/* Тёмная тема */
body.dark .bento .card-icon,
body.dark .hero .bi,
body.dark .rs-hero .bi,
body.dark .cta-light .bi,
body.dark .feature .feature-icon,
body.dark .card-article-link .bi {
  color: #5eead4;
}

/* Мобильный — иконки мельче */
@media (max-width: 767px) {
  .bento .card-icon .bi { font-size: 22px; }
  .bento > .card.b-lg > .card-top > .card-icon .bi { font-size: 24px; }
  .hero .bi { font-size: 32px; }
}

/* ═══════════════════════════════════════════════════════════════
   [BOOTSTRAP-SEARCH-ICON] Замена эмодзи-лупы на bi-search
   ═══════════════════════════════════════════════════════════════ */
header .search { position: relative; }
header .search::before {
  content: "" !important;
  display: none !important;
}
header .search input {
  padding-left: 34px !important;
  background-image: none !important;
}
header .search::after {
  content: "\f52a"; /* bi-search в font-family bootstrap-icons */
  font-family: "bootstrap-icons" !important;
  position: absolute !important;
  left: 12px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  font-size: 14px !important;
  color: #94a3b8 !important;
  pointer-events: none !important;
  z-index: 1 !important;
}
body.dark header .search::after {
  color: #64748b !important;
}

/* ═══════════════════════════════════════════════════════════════
   [ICON-VARIANT-A] Единый стиль иконок в карточках
   Белый фон, бирюзовая обводка 1.5px, тёмная иконка.
   Перебивает все предыдущие стили .card-icon / .feature-icon /
   .demo-screen-icon / .fgn-card-icon.
   ═══════════════════════════════════════════════════════════════ */
html body .bento > .card > .card-top > .card-icon,
html body .bento > .card > .card-icon,
html body .bento .card-icon,
html body .feature .feature-icon,
html body .demo-screen-icon,
html body .store-card-icon,
html body .fgn-card > div[style*="font-size"],
html body .card .card-icon {
  background: var(--bg-primary) !important;
  background-image: none !important;
  border: 1.5px solid #14b8a6 !important;
  border-radius: 12px !important;
  color: var(--text-primary) !important;
}

/* Иконки внутри наследуют цвет родителя */
html body .bento .card-icon .bi,
html body .feature .feature-icon .bi,
html body .demo-screen-icon .bi,
html body .store-card-icon .bi,
html body .card-icon .bi {
  color: inherit !important;
  display: block !important;
  line-height: 1 !important;
}

/* Размер иконки в маленьких карточках */
html body .bento > .card .card-icon .bi {
  font-size: 22px !important;
}

/* Размер в b-lg */
html body .bento > .card.b-lg > .card-top > .card-icon .bi {
  font-size: 26px !important;
}

/* Feature-иконки */
html body .feature .feature-icon .bi {
  font-size: 24px !important;
}

/* Demo-screen-icon */
html body .demo-screen-icon .bi {
  font-size: 20px !important;
}

/* Store-карточки (свои классы, не bento) */
html body .store-card .store-card-icon .bi {
  font-size: 22px !important;
}

/* ═══ Тёмная тема ═══ */
html body.dark .bento > .card > .card-top > .card-icon,
html body.dark .bento > .card > .card-icon,
html body.dark .bento .card-icon,
html body.dark .feature .feature-icon,
html body.dark .demo-screen-icon,
html body.dark .store-card-icon,
html body.dark .fgn-card > div[style*="font-size"],
html body.dark .card .card-icon {
  background: #0f172a !important;
  background-image: none !important;
  border-color: #5eead4 !important;
  color: #f1f5f9 !important;
}

/* ═══ Отступы по краям (8px-grid) ═══ */
html body .bento > .card > .card-top > .card-icon,
html body .bento .card-icon {
  margin-bottom: 8px !important;
}

/* Иконка не сжимается */
html body .bento .card-icon,
html body .feature .feature-icon,
html body .store-card-icon {
  flex-shrink: 0 !important;
}


/* ── Компактный hero для модуля проверки (2026-10-17) ── */
.hero.hero--compact { padding: 8px 0 10px !important; }
.hero.hero--compact h1 { font-size: 22px !important; margin: 0 0 4px !important; line-height: 1.2 !important; }
.hero.hero--compact p { font-size: 13px !important; margin: 0 !important; line-height: 1.4 !important; }

/* ── Save button в шапке (accent-outline) ── */
.contract-header .header-main #saveDocBtn {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}
.contract-header .header-main #saveDocBtn:hover {
  background: rgba(37,99,235,0.10) !important;
}

/* P8: default button style for dynamically injected nav-menu-btn */
.nav-menu-btn { background: var(--bg-primary) !important; color: var(--text-primary) !important; border: 1px solid var(--border-color) !important; }

/* P9: Privacy banner dark/light theme override */
.privacy-banner { background: var(--bg-secondary) !important; color: var(--text-primary) !important; border-top: 1px solid var(--border-color) !important; }
