/* Блок «До / После» AVAT: экран «как сейчас» и экран «как будет» под одной шторкой, которую двигают ползунком,
   и таблица «было → стало» по шагам. Цвета из tokens.css, запасные значения для страниц без токенов. */
.ba { --ba-ink: var(--ink, #20282C); --ba-muted: var(--muted, #5C6A71); --ba-line: var(--line, #CCD3D7); --ba-paper: var(--paper, #F6F7F7);
  --ba-depth: var(--depth, #111C23); --ba-oxide: var(--oxide, #7A4037); --ba-ok: var(--ui-success, #3F7A5E); --ba-err: var(--ui-error, #8B3530);
  display: grid; gap: clamp(28px, 3vw, 44px); color: var(--ba-ink); font-family: var(--body, Inter, Arial, sans-serif); }

/* три контраста одной строкой: было зачёркнуто, стало крупно */
.ba-wins { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ba-line); }
.ba-wins li { display: grid; gap: 8px; padding: 22px 24px 22px 0; min-width: 0; }
.ba-wins li + li { padding-left: 24px; border-left: 1px solid var(--ba-line); }
.ba-wins small { font-size: 12px; letter-spacing: .02em; color: var(--ba-muted); }
.ba-wins s { font-size: 15px; line-height: 1.4; color: var(--ba-muted); text-decoration-color: rgba(139, 53, 48, .7); text-decoration-thickness: 1.5px; }
.ba-wins b { font: 400 clamp(21px, 1.8vw, 28px)/1.2 var(--head, Geologica, Arial); letter-spacing: -.025em; font-variation-settings: var(--heading-variation, normal); }

/* шторка */
.ba-frame { position: relative; overflow: hidden; aspect-ratio: 16 / 8.2; border: 1px solid var(--ba-line); border-radius: 24px; background: #fff;
  box-shadow: 0 20px 56px rgba(17, 28, 35, .10), 0 2px 8px rgba(17, 28, 35, .04); user-select: none; touch-action: pan-y; }
.ba-screen { position: absolute; inset: 0; padding: clamp(18px, 2.4vw, 36px); }
.ba-before { background: #EDEFF0; }
.ba-after { background: var(--ba-depth); color: #EEF2F3; clip-path: inset(0 0 0 var(--ba-pos, 50%)); }
.ba-tag { position: absolute; top: 16px; z-index: 3; padding: 7px 12px; border-radius: 2px; font: 500 13px/1 var(--body, Inter, Arial); pointer-events: none; }
.ba-tag--before { left: 16px; background: #fff; color: var(--ba-ink); box-shadow: 0 1px 3px rgba(17, 28, 35, .12); }
.ba-tag--after { right: 16px; background: var(--ba-oxide); color: #F6F7F7; }
.ba-handle { position: absolute; top: 0; bottom: 0; left: var(--ba-pos, 50%); z-index: 4; width: 0; pointer-events: none; }
.ba-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(17, 28, 35, .12); }
.ba-handle i { position: absolute; top: 50%; left: 0; display: grid; place-items: center; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: #fff; color: var(--ba-ink); box-shadow: 0 6px 18px rgba(17, 28, 35, .25); font: 500 16px/1 var(--body, Inter, Arial); font-style: normal; letter-spacing: -1px; }
.ba-range { position: absolute; inset: 0; z-index: 5; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.ba-range:focus-visible + .ba-handle i { outline: 3px solid var(--ba-oxide); outline-offset: 3px; }

/* экран «до»: файлы, таблица с ошибками, письмо с копией */
.ba-desk { position: relative; height: 100%; }
.ba-win { position: absolute; overflow: hidden; border: 1px solid #C9D0D4; border-radius: 6px; background: #fff; box-shadow: 0 8px 20px rgba(17, 28, 35, .10); font-size: 12px; }
.ba-win header { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: #F1F3F4; border-bottom: 1px solid #DDE2E5; font-size: 11px; color: var(--ba-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ba-win header i { width: 8px; height: 8px; border-radius: 2px; background: #3F7A5E; flex: none; }
.ba-win header i.r { background: #B5643A; }
.ba-sheet { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ba-sheet td { padding: 6px 10px; border-bottom: 1px solid #EEF0F1; border-right: 1px solid #EEF0F1; white-space: nowrap; }
.ba-sheet tr.dup td { background: rgba(139, 53, 48, .08); }
.ba-sheet tr.gap td:last-child { background: rgba(143, 91, 14, .12); color: #8F5B0E; }
/* левая половина видна сразу, правая открывается, когда шторку тянут вправо: там письмо и часы */
.ba-w1 { left: 0; top: 34px; width: 40%; }
.ba-w2 { left: 14%; top: 46%; width: 34%; }
.ba-w3 { right: 13%; top: 30%; width: 34%; }
.ba-mail p { margin: 0; padding: 8px 12px 0; line-height: 1.5; }
.ba-mail p:last-child { padding-bottom: 12px; color: var(--ba-muted); }
.ba-note { position: absolute; left: 30%; top: 6%; z-index: 2; padding: 10px 12px; background: #F6E7A6; color: #3A3418; font: 500 13px/1.35 var(--body, Inter, Arial); transform: rotate(-3deg); box-shadow: 0 6px 14px rgba(17, 28, 35, .15); }
.ba-clock { position: absolute; right: 14%; bottom: 8%; padding: 6px 10px; border-radius: 4px; background: rgba(139, 53, 48, .9); color: #fff; font: 500 12px/1.3 var(--body, Inter, Arial); }

/* экран «после»: одна сводка */
/* сводка в правой половине: видна целиком, пока шторка посередине */
.ba-report { display: grid; align-content: center; gap: 14px; width: min(46%, 600px); height: 100%; margin-left: auto; }
.ba-report-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ba-report-head b { font: 400 clamp(17px, 1.6vw, 24px)/1.2 var(--head, Geologica, Arial); letter-spacing: -.02em; }
.ba-live { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: rgba(238, 242, 243, .74); white-space: nowrap; }
.ba-live i { width: 7px; height: 7px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 8px #22C55E; }
.ba-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ba-kpi { padding: 12px 14px; border: 1px solid rgba(238, 242, 243, .1); border-radius: 12px; background: rgba(238, 242, 243, .04); }
.ba-kpi small { display: block; font-size: 11px; color: rgba(238, 242, 243, .62); }
.ba-kpi b { display: block; margin-top: 4px; font: 400 clamp(20px, 2vw, 30px)/1.1 var(--head, Geologica, Arial); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ba-bars { display: flex; align-items: flex-end; gap: 6px; height: clamp(90px, 11vw, 160px); padding: 12px 14px; border: 1px solid rgba(238, 242, 243, .1); border-radius: 12px; }
.ba-bars i { flex: 1; height: var(--h); border-radius: 3px 3px 0 0; background: linear-gradient(180deg, #D5E7EE, #6F9FB2); }
.ba-bars i.now { background: linear-gradient(180deg, #ECD09B, #C69752); }
.ba-exc { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 10px; background: rgba(198, 151, 82, .12); font-size: 12px; }
.ba-exc b { font-weight: 500; color: #ECD09B; }

/* шаги: было → стало */
.ba-steps { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ba-line); }
.ba-steps li { display: grid; grid-template-columns: 120px minmax(0, 1fr) 28px minmax(0, 1fr); align-items: start; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--ba-line); }
.ba-steps b { font: 400 18px/1.3 var(--head, Geologica, Arial); letter-spacing: -.02em; }
.ba-steps .was { font-size: 15px; line-height: 1.5; color: var(--ba-muted); }
.ba-steps .now { font-size: 15px; line-height: 1.5; font-weight: 500; }
.ba-steps .arr { color: var(--ba-oxide); font-size: 18px; line-height: 1.3; text-align: center; }
.ba-note-line { margin: 0; font-size: 12px; color: var(--ba-muted); }

@media (max-width: 900px) {
  .ba-wins { grid-template-columns: minmax(0, 1fr); }
  .ba-wins li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--ba-line); }
  /* на телефоне шторка тесная: два экрана один под другим */
  .ba-frame { aspect-ratio: auto; border-radius: 22px; }
  .ba-screen { position: relative; inset: auto; }
  .ba-before { height: 400px; }
  .ba-after { clip-path: none; padding-top: 56px; }
  .ba-tag--after { top: 416px; left: 16px; right: auto; }
  .ba-range, .ba-handle { display: none; }
  .ba-report { width: 100%; }
  .ba-w1 { left: 0; top: 34px; width: 86%; } .ba-w2 { left: 10%; top: 50%; width: 80%; } .ba-w3 { display: none; }
  .ba-note { left: auto; right: 0; top: 30%; } .ba-clock { left: 0; right: auto; bottom: 0; }
  .ba-kpis { grid-template-columns: 1fr 1fr; } .ba-kpi:last-child { display: none; }
  .ba-steps li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .ba-steps .arr { display: none; }
  .ba-steps .now::before { content: "→ "; color: var(--ba-oxide); }
}
@media (prefers-reduced-motion: reduce) { .ba-after, .ba-handle { transition: none !important; } }
