/* Блок «Безопасность» (#bezopasnost). Только токены из style.css.
   Цвета мини-окна взяты из .site-card и plans-motion (живут только в демо-окне),
   цвета Telegram из .tg. «Атака» = --error, «защищено» = --ok (новый токен, по просьбе Захара),
   оранжевый --accent только как фирменный акцент (полоска вкладки, кнопки, фокус).
   --ok #4cc38a: на тёмном #121214 контраст 8.4:1 (можно текстом); на светлом окне только как заливка
   под тёмной галочкой (#0b0b0c на --ok = 8.9:1), текстом на светлом не используется. */

.sx-grid { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: var(--s-5); align-items: stretch; }
/* окно тянется на высоту левой колонки: низ окна и низ текста на одной линии */
@media (min-width: 961px) {
  .sx-demo, .sx-win { display: flex; flex-direction: column; }
  .sx-win { flex: 1; }
  .sx-body { flex: 1; height: auto; min-height: 400px; }
}
.sx-lead { color: var(--soft); font-size: var(--fs-lead); line-height: 1.5; }
.sx-honest { margin-top: var(--s-2); padding-top: var(--s-2); border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-small); line-height: 1.5; }
.sx-h2b { display: inline-block; } /* вторая половина заголовка переносится целиком */

/* карточка текущей атаки (кайма сверху, как у Стандарта в таблице) */
.sx-now { margin-top: var(--s-3); padding: var(--s-2) var(--s-3) var(--s-3); background: var(--surface); border: 1px solid var(--line);
  border-top: 2px solid var(--accent); border-radius: var(--r-l); }
.sx-now__top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2);
  color: var(--muted); font-size: var(--fs-label); letter-spacing: .06em; text-transform: uppercase; }
.sx-now__top b { color: var(--text); font-weight: 500; }
.sx-steps { display: flex; gap: 4px; }
.sx-steps i { width: 14px; height: 3px; border-radius: 2px; background: var(--dim); transition: background var(--t-fast) var(--ease); }
.sx-steps i.is-on { background: var(--accent); }
.sx-now__t { margin-top: 12px; color: var(--text); font-size: var(--fs-h3); font-weight: 500; letter-spacing: var(--tr-h3); line-height: 1.2; }
.sx-cap { margin-top: var(--s-1); color: var(--soft); font-size: var(--fs-small); line-height: 1.5; min-height: 3em; }
.sx-now__t, .sx-cap { transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
.sx-now.is-out .sx-now__t, .sx-now.is-out .sx-cap { opacity: 0; transform: translateY(4px); }
.sx-now__nav { display: flex; gap: var(--s-1); margin-top: var(--s-2); }
.sx-prev { width: 42px; padding-left: 0; padding-right: 0; }
.sx-next { flex: 1; }

/* ---------- окно браузера ---------- */
.sx-win { background: #f4f2ee; color: #121214; border-radius: var(--r-l); overflow: hidden; }
.sx-tabsrow { display: flex; align-items: flex-end; gap: 14px; padding: 8px 8px 0 16px; background: #e6e3dd; }
.sx-dots { display: flex; gap: 6px; align-self: center; padding-top: 8px; flex: none; }
.sx-dots i { width: 10px; height: 10px; border-radius: 50%; background: #c9c5be; }
.sx-tabs { display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
.sx-tabs::-webkit-scrollbar { display: none; }
.sx-tab { position: relative; flex: none; height: 38px; padding: 0 16px; border: 0; border-radius: 10px 10px 0 0; background: transparent;
  font: 400 13px/1 var(--sans); color: #7a766f; cursor: pointer; scroll-snap-align: start; white-space: nowrap;
  transition: color var(--t-fast), background var(--t-fast); }
.sx-tab:hover { color: #121214; }
.sx-tab[aria-selected="true"] { background: #f4f2ee; color: #121214; font-weight: 500; }
.sx-tab:focus-visible { outline-offset: -3px; }
/* оранжевая кайма сверху у активной вкладки; при автопоказе заполняется как полоса времени */
.sx-tab__bar { position: absolute; left: 12px; right: 12px; top: 0; height: 2px; border-radius: 0 0 2px 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: 0 50%; opacity: 0; transition: opacity var(--t-base); }
.sx-tab[aria-selected="true"] .sx-tab__bar { opacity: 1; }

.sx-body { position: relative; height: 440px; container-type: inline-size; }
.sx-body:focus-visible { outline: none; }
.sc { position: absolute; inset: 0; opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .45s var(--ease), transform .45s var(--ease); }
.sc.is-on { opacity: 1; transform: none; pointer-events: auto; }
.sc.is-leaving { transform: translateY(-6px); }
.sc:focus-visible { outline-offset: -3px; }
.sc__in { position: absolute; inset: 0; display: flex; flex-direction: column; }

.sx-addr { flex: none; height: 44px; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid #e6e3dd; }
.sx-url { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px 6px 12px; border-radius: var(--r-pill); background: #e6e3dd; color: #7a766f; font: 12px/1.3 var(--mono); white-space: nowrap; }
.sx-url svg { width: 12px; height: 12px; flex: none; }
.sx-url__p { color: #121214; }
.sx-page { position: relative; flex: 1; min-height: 0; overflow: hidden; padding: 20px 20px 74px; }

/* мелкие детали мини-сайта (как в plans-motion) */
.sx-body .b { display: block; height: 6px; border-radius: 3px; background: #ddd8d0; }
.sx-body .b--d { background: #c9c5be; }
.sx-card { background: #fff; border: 1px solid #e6e3dd; border-radius: 12px; padding: 18px; }
.sx-title { font: 500 15px/1.25 var(--sans); letter-spacing: -.02em; }
.sx-lbl { margin: 12px 0 6px; font-size: 12px; line-height: 1.3; color: #8a857c; }
.sx-in { position: relative; height: 36px; display: flex; align-items: center; gap: 0; padding: 0 12px; border: 1.5px solid #ddd8d0; border-radius: var(--r-s);
  background: #fff; font: 13px/1 var(--sans); white-space: nowrap; overflow: hidden; }
.sx-in .b { width: 46%; }
.sx-in--mono { font: 12.5px/1 var(--mono); }
.sx-ring { position: absolute; inset: -1.5px; border: 1.5px solid var(--accent); border-radius: inherit; opacity: 0; pointer-events: none; }
.sx-ring--err { border-color: var(--error); }
.sx-ph { position: absolute; left: 12px; color: #8a857c; font-family: var(--sans); font-size: 13px; }
.sx-caret { flex: none; width: 1px; height: 15px; margin-left: 1px; background: #121214; opacity: 0; }
.sx-btn { position: relative; display: grid; place-items: center; height: 38px; margin-top: 14px; border-radius: var(--r-pill); background: var(--accent); color: #0b0b0c; font: 500 13px/1 var(--sans); overflow: hidden; }
.sx-btn > span { grid-area: 1 / 1; position: relative; display: flex; align-items: center; gap: 7px; }
.sx-btn svg { width: 14px; height: 14px; }
.sx-btn .sx-btn__dark { position: absolute; inset: 0; background: #121214; opacity: 0; }
.sx-btn [data-l-b] { color: #f4f2ee; opacity: 0; }
.sx-btn--s { display: inline-grid; height: 30px; margin-top: 6px; padding: 0 16px; font-size: 12px; justify-self: start; }

/* бот: тёмная карточка с моно-списком (то, что делает атакующий) */
.sx-bot { background: #121214; color: var(--soft); border-radius: 12px; padding: 14px 16px 10px; font: 12px/1.3 var(--mono); }
.sx-bot__h { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.sx-bot__h svg { width: 16px; height: 16px; color: var(--error); flex: none; }
.sx-bot__h b { font: 500 13px/1.2 var(--sans); color: var(--text); }
.sx-sw { margin-left: auto; display: grid; justify-items: end; color: var(--muted); font-size: 11px; }
.sx-sw > span { grid-area: 1 / 1; }
.sx-sw [data-st-b] { opacity: 0; }
.sx-list { position: relative; list-style: none; padding-top: 4px; }
.sx-list li { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 28px; padding: 0 8px; }
.sx-list li > span { white-space: nowrap; }
.sx-list svg { width: 14px; height: 14px; color: var(--error); opacity: 0; flex: none; }
.sx-list em { font-style: normal; color: var(--muted); font-size: 11px; opacity: 0; white-space: nowrap; }
.sx-list li:not([data-item]):not(.sx-hl) { color: var(--muted); }
.sx-list .sx-hl { position: absolute; left: 0; right: 0; top: 4px; padding: 0; border-radius: 6px; background: rgba(255,255,255,.07); opacity: 0; }

/* итог сцены: одна таблетка внизу, надпись меняется на ней же (атака -> защита) */
.sx-v { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; background: #121214; color: #f4f2ee;
  border-radius: var(--r-pill); font: 13px/1.3 var(--sans); white-space: nowrap; overflow: hidden; }
.sx-v > span { grid-area: 1 / 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px 9px 12px; }
.sx-v svg { width: 16px; height: 16px; flex: none; }
.sx-v__a svg { color: var(--error); }
.sx-v__b { opacity: 0; }
.sx-v__b { color: var(--ok); }
.sx-v__b svg { color: var(--ok); }

/* ---------- 1. подбор пароля ---------- */
.s1 { height: 100%; display: flex; align-items: center; justify-content: center; gap: 40px; }
.s1-bot { width: 200px; flex: none; }
.s1-card { width: 300px; flex: 0 1 300px; padding-bottom: 18px; }
.s1-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.s1-count { display: inline-flex; align-items: baseline; gap: 4px; font: 11px/1.3 var(--mono); color: #8a857c; opacity: 0; white-space: nowrap; }
.sx-roll { display: inline-block; height: 1.3em; overflow: hidden; vertical-align: bottom; color: #121214; }
.sx-roll__in { display: block; }
.sx-roll__in span { display: block; height: 1.3em; }
.sx-hint { display: grid; height: 18px; margin-top: 6px; font-size: 12px; line-height: 18px; color: #8a857c; }
.sx-hint > span { grid-area: 1 / 1; opacity: 0; }
.sx-hint--err { color: var(--error); }
.s1-card .sx-btn { margin-top: 8px; }

/* ---------- 2–3. форма + таблица / Telegram ---------- */
.s2 { height: 100%; display: grid; grid-template-columns: minmax(0, 270px) minmax(0, 1fr); gap: 20px; align-items: center; }
.sx-tbl { position: relative; background: #fff; border: 1px solid #e6e3dd; border-radius: 12px; overflow: hidden; }
.sx-tbl__ring { position: absolute; inset: 0; border: 1.5px solid var(--error); border-radius: inherit; opacity: 0; pointer-events: none; z-index: 2; }
.sx-tbl__h { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 44px; padding: 0 16px; border-bottom: 1px solid #e6e3dd; font: 500 13px/1.2 var(--sans); }
.sx-rows { position: relative; height: 160px; }
.sx-r { position: absolute; left: 0; right: 0; top: 0; height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; border-bottom: 1px solid #f4f2ee; font-size: 13px; background: #fff; }
.sx-r .b { flex: none; }
.sx-r--new { background: color-mix(in srgb, var(--ok) 9%, #fff); opacity: 0; z-index: 1; }
.sx-r__code { font: 12px/1 var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sx-r__ok { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--ok); color: #0b0b0c; }
.sx-r__ok svg { width: 12px; height: 12px; }

.sx-tg { background: #0e1621; color: var(--text); border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,.06); }
.sx-tg__h { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px; background: #1e2c3a; }
.sx-tg__ava { width: 30px; height: 30px; flex: none; }
.sx-tg__h b { display: block; font: 500 13px/1.3 var(--sans); }
.sx-tg__h small { display: block; color: #6c8aa5; font-size: 12px; line-height: 1.3; }
.sx-tg__feed { position: relative; height: 196px; overflow: hidden; } /* старое сообщение уезжает вверх, как в чате */
.sx-msg { position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px); background: #182533; border-radius: 14px 14px 14px 4px; padding: 9px 13px 10px; font: 13px/1.45 var(--sans); }
.sx-msg__t { color: var(--accent-2); font-weight: 500; }
.sx-msg__m { color: #6c8aa5; }
.sx-msg[data-new] { opacity: 0; }
.sx-code { display: inline-block; margin-top: 4px; padding: 3px 7px; border-radius: 6px; background: rgba(255,255,255,.07); font: 12px/1.4 var(--mono); color: var(--text); white-space: nowrap; }

/* ---------- 4. старые плагины ---------- */
.s4 { height: 100%; display: grid; grid-template-columns: minmax(0, 270px) minmax(0, 1fr); gap: 20px; align-items: center; }
.s4-site { position: relative; height: 230px; background: #fff; border: 1px solid #e6e3dd; border-radius: 12px; overflow: hidden; }
.s4-home { position: absolute; inset: 0; padding: 16px 18px; display: grid; align-content: start; gap: 10px; }
.s4-nav { display: flex; align-items: center; gap: 8px; height: 14px; margin-bottom: 8px; }
.s4-nav .b:first-child { margin-right: auto; }
.s4-h { font-size: 18px; }
.s4-404 { position: absolute; inset: 0; display: grid; place-items: center; background: #fff; opacity: 0; }
.s4-404__in { display: grid; justify-items: center; gap: 6px; }
.s4-404 b { font: 500 44px/1 var(--sans); letter-spacing: -.05em; color: #c9c5be; }
.s4-404 span { font-size: 13px; color: #5f5b55; }

/* ---------- 5. DDoS ---------- */
.s5 { position: relative; height: 100%; }
.s5-src { position: absolute; left: 0; top: 0; bottom: 0; width: 40%; }
.s5-lbl { display: inline-flex; align-items: center; gap: 6px; font: 11px/1.3 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: #8a857c; }
.s5-lbl svg { width: 14px; height: 14px; color: var(--error); }
.s5-dots { position: absolute; inset: 0; pointer-events: none; }
.s5-dot { position: absolute; left: 0; top: 0; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--error); opacity: 0; }
.s5-filter { position: absolute; left: 46%; top: 0; bottom: 0; width: 2px; }
.s5-line { position: absolute; inset: 0; border-radius: 2px; background: #121214; }
.s5-line--on { background: var(--ok); opacity: 0; }
.s5-chip { position: absolute; left: 50%; top: 80%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 10px; border-radius: var(--r-pill); background: #121214; color: #f4f2ee; font: 12px/1.3 var(--sans); white-space: nowrap; }
.s5-chip svg { width: 14px; height: 14px; color: var(--ok); }
.s5-site { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 38%; background: #fff; border: 1px solid #e6e3dd; border-radius: 12px; padding: 16px 18px; display: grid; gap: 10px; }
.s5-status { display: inline-flex; align-items: center; gap: 7px; justify-self: start; padding: 4px 10px 4px 5px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--ok) 14%, #fff); font-size: 12px; line-height: 1.3; }
.s5-status svg { width: 18px; height: 18px; padding: 3px; border-radius: 50%; background: var(--ok); color: #0b0b0c; }
.s5-visit { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; line-height: 1.3; color: #5f5b55; opacity: 0; }
.s5-visit svg, .s5-client svg { width: 14px; height: 14px; flex: none; }
/* капча: нейтральный виджет «Я не робот», без чужих логотипов */
.s5-cap { position: absolute; left: 46%; top: 50%; width: 0; height: 0; z-index: 3; }
.s5-cap__card { position: absolute; left: -76px; top: -23px; width: 152px; height: 46px; display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: #fff; border: 1px solid #ddd8d0; border-radius: var(--r-s); box-shadow: 0 6px 20px rgba(18,18,20,.08); opacity: 0; }
.s5-box { position: relative; flex: none; width: 20px; height: 20px; border: 2px solid #c9c5be; border-radius: 4px; }
.s5-box > span { position: absolute; inset: -2px; display: grid; place-items: center; border-radius: 4px; opacity: 0; }
.s5-box svg { width: 13px; height: 13px; }
.s5-box__x { background: var(--error); color: #fff; }
.s5-box__ok { background: var(--ok); color: #0b0b0c; }
.s5-cap__l { display: grid; font-size: 13px; line-height: 1.3; white-space: nowrap; }
.s5-cap__l > span { grid-area: 1 / 1; }
.s5-cap__l [data-cl-bad], .s5-cap__l [data-cl-ok] { opacity: 0; }
/* «Не пройдено» тёмным текстом: красный --error на белом не дотягивает до 4.5:1, смысл несёт красный квадрат */
.s5-req { position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 8px; border-radius: var(--r-pill); background: #fff; border: 1px dashed var(--error); font: 12px/1.3 var(--sans); white-space: nowrap; opacity: 0; z-index: 2; }
.s5-req svg { width: 14px; height: 14px; flex: none; color: var(--error); }
.s5-client { position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 8px; border-radius: var(--r-pill); background: #fff; border: 1px solid #ddd8d0; font: 12px/1.3 var(--sans); white-space: nowrap; opacity: 0; z-index: 2; }

/* ---------- узкое окно (телефон): компоновка сцен в столбик ---------- */
@container (max-width: 599px) {
  .sx-page { padding: 16px 16px 70px; }
  .s1-bot { display: none; }
  .s1-card { flex-basis: 100%; max-width: 320px; }
  .s2, .s4 { grid-template-columns: minmax(0, 1fr); align-content: center; gap: 12px; }
  .sx-wide { display: none; }
  .s2 .sx-card { padding: 14px 16px 16px; }
  .s2 .sx-card .sx-btn { margin-top: 10px; }
  .sx-rows { height: 120px; }
  .sx-tg__feed { height: 138px; }
  .sx-tg__h { height: 46px; }
  .s4-site { height: 132px; }
  .s4-home { padding: 12px 14px; gap: 8px; }
  .s4-nav { margin-bottom: 2px; }
  .s4-404 b { font-size: 34px; }
  /* DDoS сверху вниз: боты сверху, фильтр поперёк, сайт внизу */
  .s5-src { left: 0; right: 0; top: 0; bottom: auto; width: auto; height: 34%; }
  .s5-filter { left: 0; right: 0; top: 44%; bottom: auto; width: auto; height: 2px; }
  .s5-chip { left: 0; top: 50%; transform: translateY(-50%); }
  .s5-cap { left: auto; right: 76px; top: 44%; }
  .s5-site { left: 0; right: 0; top: auto; bottom: 0; transform: none; width: auto; padding: 14px 16px; gap: 8px; }
}

/* ---------- адаптив страницы ---------- */
@media (max-width: 960px) {
  /* в одну колонку: текст → окно → карточка атаки прямо под окном → честная строка */
  .sx-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s-3); }
  .sx-text { display: contents; }
  .sx-lead { order: 1; max-width: 640px; }
  .sx-demo { order: 2; }
  .sx-now { order: 3; margin-top: 0; }
  .sx-honest { order: 4; margin-top: 0; max-width: 640px; }
}
@media (max-width: 600px) {
  /* телефон: окно-сцена и карточка атаки с кнопкой прямо под ним, один экран */
  .sx .sec__head { margin-bottom: var(--s-3); }
  .sx-grid { gap: var(--s-1); }
  .sx-lead { display: none; }
  .sx-body { height: 380px; min-height: 0; }
  .sx-tabsrow { display: none; } /* вкладки заменены карточкой и кнопками «Следующая атака» */
  .sx-addr { height: 36px; }
  .sx-page { padding: 10px 16px 46px; }
  .sx-v { bottom: 10px; }
  .sx-v > span { padding: 7px 14px 7px 10px; }
  /* сцены ниже, чтобы влезли в короткое окно */
  .sx-in { height: 32px; }
  .s2 .sx-card .sx-lbl { margin: 8px 0 4px; }
  .s2 .sx-card { padding: 12px 14px; }
  .s2 .sx-card .sx-btn { height: 32px; margin-top: 8px; }
  .s2, .s4 { gap: 10px; }
  .sx-tbl__h { height: 32px; }
  .sx-rows { height: 96px; }
  .sx-r { height: 32px; }
  .sx-r:nth-child(n+4) { display: none; }
  .sx-tg__h { height: 36px; }
  .sx-tg__feed { height: 100px; }
  .sx-msg { padding: 6px 12px 7px; line-height: 1.35; }
  .sx-bot { padding: 8px 12px 6px; }
  .sx-bot__h { padding-bottom: 6px; }
  .sx-list li { height: 24px; }
  .sx-list .sx-hl { height: 24px; }
  .s4-site { height: 100px; }
  .s4-home { padding: 10px 14px; gap: 6px; }
  .s4-404 b { font-size: 28px; }
  .s4-home .sx-btn { display: none; }
  .sx-now { padding: 12px var(--s-2) var(--s-2); margin-top: 0; }
  .sx-steps { display: none; }
  .sx-now__t { margin-top: 6px; font-size: var(--fs-lead); }
  .sx-cap { margin-top: 2px; }
  .sx-now__nav { margin-top: var(--s-1); }
  .sx-now__nav .btn { min-height: 44px; }
  .sx-prev { width: 52px; }
  .sx-honest { margin-top: var(--s-1); padding-top: var(--s-1); }
}
