html { scrollbar-gutter: stable; }

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

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

  /* Адаптивные отступы */
  --pad-x: clamp(12px, 2vw, 32px);
  --gap: clamp(8px, 1vw, 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: hidden;
}

/* ---------- Контейнер — центрируется, не растягивается ---------- */
.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: clamp(110px, 8vw, 140px);
  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(18px, 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(10px, 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(10px, 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(10px, 1vw, 16px);
  padding: clamp(14px, 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(14px, 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 6px;
  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 10px;
  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(10px, 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(18px, 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(10px, 1vw, 14px); margin-bottom: clamp(14px, 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: 6px; }
  .rs-step { padding: 10px 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: 14px 16px; }

  .rs-modal { padding: 10px; }
  .rs-modal-box { padding: 18px; 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: 6px !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: 10px 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: 12.5px !important;
  line-height: 1.4 !important;
}

.rs-bento-hero {
  background: #ffffff !important;
}
body.dark .rs-bento-hero {
  background: #1e293b !important;
}

/* ============================================================
   MOBILE HEADER v3
   ============================================================ */
@media (max-width: 900px) {
  header { padding: 6px 0 !important; }
  header .container,
  header .header-inner {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !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 6px !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: 6px !important;
  }
}


/* ============================================================
   FOOTER — 3 зоны: копирайт | баннер | ссылки
   ============================================================ */
footer {
  padding: 12px 0 !important;
  margin: 20px 0 0 0 !important;
  width: 100% !important;
  background: var(--bg-secondary, #fff) !important;
  border-top: 1px solid var(--border-color, #e2e8f0) !important;
}
.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: 12.5px !important;
  line-height: 1.35 !important;
  background: transparent !important;
  border: none !important;
}

.footer-copy {
  flex: 0 0 auto !important;
  font-weight: 600 !important;
  color: var(--text-primary, #0f172a) !important;
  font-size: 13px !important;
  white-space: nowrap !important;
}

.footer-note {
  flex: 1 1 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  text-align: center !important;
  color: var(--text-muted, #64748b) !important;
  font-size: 12px !important;
  min-width: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.footer-note i { color: var(--accent, #2563eb) !important; font-size: 12px !important; }

.footer-links {
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  white-space: nowrap !important;
}
.footer-links a {
  font-size: 12.5px !important;
  color: var(--text-secondary, #475569) !important;
  padding: 2px 6px !important;
  text-decoration: none !important;
  cursor: pointer !important;
  transition: color .15s !important;
}
.footer-links a:hover { color: var(--accent, #2563eb) !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;
  }
  .footer-copy { order: 2 !important; font-size: 12px !important; }
  .footer-note { order: 3 !important; font-size: 11px !important; white-space: normal !important; }
  .footer-links {
    order: 1 !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  .footer-links a { font-size: 11.5px !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: 12.5px !important;
  background: transparent !important;
  border: none !important;
  visibility: visible !important;
  opacity: 1 !important;
}

footer .footer-copy {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: static !important;
  flex: 0 0 auto !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  overflow: visible !important;
  text-indent: 0 !important;
  text-overflow: clip !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  white-space: nowrap !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 1 !important;
}
body.dark footer .footer-copy { color: #e2e8f0 !important; }

footer .footer-note {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: static !important;
  flex: 1 1 auto !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  text-align: center !important;
  color: #64748b !important;
  font-size: 12px !important;
  min-width: 0 !important;
  max-width: none !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin: 0 !important;
}
footer .footer-note i { color: #2563eb !important; font-size: 12px !important; }

footer .footer-links {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: static !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  white-space: nowrap !important;
  margin: 0 !important;
}
footer .footer-links a {
  display: inline-block !important;
  font-size: 12.5px !important;
  color: #475569 !important;
  padding: 2px 6px !important;
  text-decoration: none !important;
  cursor: pointer !important;
}
footer .footer-links a:hover { color: #2563eb !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-copy { order: 2 !important; font-size: 12px !important; }
  footer .footer-note { order: 3 !important; font-size: 11px !important; white-space: normal !important; }
  footer .footer-links {
    order: 1 !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  footer .footer-links a { font-size: 11.5px !important; }
}


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

#globalFooter {
  display: block !important;
  width: 100% !important;
  background: #ffffff !important;
  border-top: 1px solid #e2e8f0 !important;
  padding: 10px 0 !important;
  margin: 20px 0 0 0 !important;
  box-sizing: border-box !important;
  position: static !important;
  font-family: inherit !important;
}
#globalFooter > div {
  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 40px !important;
  box-sizing: border-box !important;
  font-size: 12.5px !important;
  line-height: 1.35 !important;
}
#globalFooter > div > div:nth-child(1) {
  flex: 0 0 auto !important;
  font-weight: 600 !important;
  color: #0f172a !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: 10px !important;
  white-space: nowrap !important;
}
#globalFooter a {
  color: #475569 !important;
  text-decoration: none !important;
  font-size: 12.5px !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: 6px !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: 6px !important; }
  #globalFooter a { font-size: 11.5px !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: flex !important;
  flex-direction: column !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: 6px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 14px !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: 10px 16px !important;
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 12px !important;
  margin-bottom: 10px !important;
}
.contract-header .actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-left: auto !important;
  flex-wrap: wrap !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: 6px !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: 22px 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 10px !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: 18px !important;
  }
}
