/* Админка v6 = шапка и ответы из admin-v5 + одна строка из admin-v3. Только токены style.css.
   Светлые цвета мини-окон (#fff, #f4f2ee, #f0ede8, #e6e3dd, #ddd8d0, #8a857c, #7a766f, #5f5b55, #121214)
   и цвета Telegram (#0e1621, #1e2c3a, #182533, #2b5278, #6c8aa5, #17212b) те же, что в v3/v5, живут только внутри демо. */

.av { --cols: minmax(0, 1fr) minmax(0, 360px) 56px minmax(0, 248px); }

/* ---------- из v5: вопрос ---------- */
.av-head { margin-bottom: var(--s-4); }
.av-lead { margin-top: var(--s-3); max-width: 560px; color: var(--soft); font-size: var(--fs-lead); line-height: 1.5; }

/* ---------- из v5: ответы-пилюли (радиокнопки) ---------- */
.av-answers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.av-ans { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 14px 24px 14px 18px; text-align: left; cursor: pointer;
  border: 1px solid rgba(255,255,255,.18); border-radius: var(--r-pill); background: transparent; color: var(--text);
  font: inherit; font-size: var(--fs-lead); line-height: 1.25; letter-spacing: -.01em;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-base) var(--ease); }
.av-ans:hover { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.3); }
.av-ans:active { transform: scale(.98); }
.av-ans:focus-visible { outline-offset: 3px; border-radius: var(--r-pill); }
.av-ans[aria-checked="true"] { background: var(--text); color: #0b0b0c; border-color: var(--text); }
.av-ans__s { display: none; }
.av-ans__r { position: relative; flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.3);
  transition: border-color var(--t-fast), background var(--t-fast); }
.av-ans__r::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: #0b0b0c; transform: scale(0); transition: transform var(--t-base) var(--ease); }
.av-ans[aria-checked="true"] .av-ans__r { border-color: var(--accent); background: var(--accent); }
.av-ans[aria-checked="true"] .av-ans__r::after { transform: scale(1); }

/* ---------- из v3: строка ---------- */
.av-box { margin-top: var(--s-5); }
.av-cols { display: grid; grid-template-columns: var(--cols); gap: var(--s-3); padding-bottom: 12px; color: var(--muted); }
.av-row { display: grid; grid-template-columns: var(--cols); gap: var(--s-3); align-items: center; padding: var(--s-4) 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* тихий режим до ответа: пример первого способа, приглушён */
.av-stage, .av-wire, .av-res, .av-infos { transition: opacity var(--t-slow) var(--ease); }
.av-box.is-quiet :is(.av-stage, .av-wire, .av-res, .av-infos) { opacity: .7; }

/* слева: метка «Пример / Ваш ответ» на месте номера, название, «Подходит, если…», повтор */
.av-info { align-self: stretch; display: flex; flex-direction: column; align-items: flex-start; }
.av-tag { color: var(--muted); transition: color var(--t-fast); }
.av-box:not(.is-quiet) .av-tag { color: var(--accent); }
.av-infos { display: grid; width: 100%; }
.av-name { margin-top: 10px; font: 500 var(--fs-row)/1.1 var(--sans); letter-spacing: -.035em; }
.av-fit { margin-top: 10px; max-width: 340px; color: var(--soft); font-size: var(--fs-small); line-height: 1.5; }
.av-fit span { color: var(--muted); }
.av-replay { margin-top: auto; white-space: nowrap; }
.av-replay[hidden] { display: inline-flex; visibility: hidden; } /* место под кнопку занято всегда */

/* варианты лежат друг на друге: высота = самый длинный. Смена по очереди: старый гаснет, потом новый проявляется */
.av-i, .av-pane { grid-area: 1 / 1; opacity: 0; visibility: hidden;
  transition: opacity .15s linear, visibility 0s linear .15s; }
.av-i.is-on, .av-pane.is-on { opacity: 1; visibility: visible;
  transition: opacity .22s var(--ease) .15s, visibility 0s linear .15s; }
.av-i { padding-bottom: var(--s-2); }

/* ---------- детали сцен (из v3) ---------- */
.av-stage { position: relative; display: grid; }
.av-sc { position: relative; height: 148px; border-radius: var(--r-m); overflow: hidden; }
.av-strip { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; background: #e6e3dd; color: #7a766f; font: 11px/1 var(--mono); white-space: nowrap; }
.av-strip svg { width: 11px; height: 11px; flex: none; }
.av-strip b { font-weight: 400; color: #121214; }
.av-caret { flex: none; width: 1px; height: 15px; margin-left: 1px; background: #121214; opacity: 0; }

/* 1. админка на сайте */
.av-adm { background: #fff; color: #121214; }
.av-tabs { display: flex; gap: 6px; padding: 12px 14px 0; }
.av-chip { padding: 4px 10px; border-radius: var(--r-pill); background: #f4f2ee; color: #5f5b55; font: 11px/1.3 var(--mono); }
.av-chip.is-on { background: #121214; color: #fff; }
.av-lbl { margin: 10px 14px 6px; font-size: 12px; line-height: 1.3; color: #8a857c; }
.av-frow { display: flex; gap: 8px; padding: 0 14px; }
.av-in { position: relative; flex: 1; min-width: 0; height: 36px; display: flex; align-items: center; padding: 0 12px; border: 1.5px solid #ddd8d0; border-radius: var(--r-s);
  font: 13px/1 var(--mono); white-space: nowrap; }
.av-ring { position: absolute; inset: -1.5px; border: 1.5px solid var(--accent); border-radius: inherit; opacity: 0; pointer-events: none; }
.av-old { position: absolute; left: 11px; display: inline-flex; align-items: center; height: 20px; padding: 0 1px; }
.av-old__hl { position: absolute; inset: 0; border-radius: 3px; background: color-mix(in srgb, var(--accent) 22%, #fff); opacity: 0; }
.av-old__t { position: relative; }
.av-save { position: relative; flex: none; display: grid; place-items: center; width: 124px; height: 36px; border-radius: var(--r-pill); background: var(--accent); color: #0b0b0c;
  font: 500 13px/1 var(--sans); overflow: hidden; }
.av-save > span { grid-area: 1 / 1; position: relative; display: flex; align-items: center; gap: 6px; }
.av-save svg { width: 13px; height: 13px; }
.av-save .av-dark { position: absolute; inset: 0; background: #121214; opacity: 0; }
.av-save [data-l-b] { color: #f4f2ee; opacity: 0; }

/* 2. Telegram-бот */
.av-tg { background: #0e1621; color: var(--text); }
.av-tg__h { display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; background: #1e2c3a; font: 500 12px/1 var(--sans); white-space: nowrap; }
.av-tg__h svg { width: 16px; height: 16px; flex: none; }
.av-tg__h small { color: #6c8aa5; font-weight: 400; font-size: 12px; }
.av-feed { position: relative; height: 80px; overflow: hidden; }
.av-msg { position: absolute; bottom: 8px; max-width: calc(100% - 20px); padding: 6px 11px; border-radius: 12px 12px 12px 4px; background: #182533; font: 13px/1.3 var(--sans); white-space: nowrap; opacity: 0; }
.av-msg--out { right: 10px; background: #2b5278; border-radius: 12px 12px 4px 12px; }
.av-msg--in { left: 10px; }
.av-msg b { color: var(--accent-2); font-weight: 500; }
.av-tgin { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 6px 0 12px; background: #17212b; border-top: 1px solid rgba(255,255,255,.06); }
.av-tgin__t { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; height: 20px; font: 13px/1 var(--sans); white-space: nowrap; overflow: hidden; }
.av-tgin__ph { position: absolute; left: 0; color: #6c8aa5; }
.av-tgin .av-caret { background: currentColor; }
.av-send { display: grid; place-items: center; width: 30px; height: 30px; flex: none; color: var(--accent-2); }
.av-send svg { width: 16px; height: 16px; }

/* 3. Google Таблица */
.av-sh { background: #fff; color: #121214; }
.av-sh__h { display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-bottom: 1px solid #e6e3dd; white-space: nowrap; }
.av-sh__h svg { width: 14px; height: 14px; flex: none; color: #5f5b55; }
.av-sh__h b { font: 500 12px/1 var(--sans); }
.av-sh__h span { margin-left: auto; font: 11px/1 var(--mono); color: #8a857c; }
.av-fx { display: flex; align-items: center; gap: 10px; height: 28px; padding: 0 12px; border-bottom: 1px solid #e6e3dd; font: 12.5px/1 var(--mono); }
.av-fx i { display: flex; align-items: center; height: 16px; padding-right: 10px; border-right: 1px solid #e6e3dd; color: #8a857c; font-style: normal; }
.av-fx__v { display: flex; align-items: center; height: 16px; }
.av-grid { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr) 80px; grid-template-rows: 22px 34px 34px; }
.av-c { display: flex; align-items: center; padding: 0 10px; border-left: 1px solid #f0ede8; border-bottom: 1px solid #f0ede8; font-size: 13px; white-space: nowrap; overflow: hidden; }
.av-c:nth-child(3n+1) { border-left: 0; }
.av-c--n { justify-content: center; padding: 0; background: #f4f2ee; color: #8a857c; font: 11px/1 var(--mono); }
.av-c--v { position: relative; justify-content: flex-end; font: 13px/1 var(--mono); font-variant-numeric: tabular-nums; }
.av-c--v > span { position: relative; }
.av-c--v > .av-fl { position: absolute; inset: 0; background: color-mix(in srgb, var(--accent) 14%, #fff); opacity: 0; }
.av-cur { position: absolute; right: 0; top: 22px; width: 80px; height: 34px; border: 2px solid var(--accent); border-radius: 2px; opacity: 0; pointer-events: none; }

/* провод: точка бежит от инструмента к сайту */
.av-wire { position: relative; height: 2px; background: var(--line); border-radius: 2px; }
.av-run { position: absolute; inset: 0; }
.av-dot { position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); opacity: 0; }

/* фрагмент сайта клиента */
.av-res { background: #fff; color: #121214; }
.av-res__bar { display: flex; align-items: center; height: 28px; padding: 0 14px; border-bottom: 1px solid #f4f2ee; font: 11px/1 var(--mono); color: #8a857c; white-space: nowrap; }
.av-res__t { padding: 12px 14px 4px; font: 500 15px/1.25 var(--sans); letter-spacing: -.02em; }
.av-res ul { list-style: none; padding: 0 14px; }
.av-pr { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 36px; border-bottom: 1px solid #f4f2ee; font-size: 13px; }
.av-pr:last-child { border-bottom: 0; }
.av-pr > span { position: relative; }
.av-pr__hl { position: absolute !important; inset: 3px -8px; border-radius: var(--r-s); background: color-mix(in srgb, var(--accent) 14%, #fff); opacity: 0; }
.av-val { display: inline-grid; justify-items: end; font: 500 13px/1.3 var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap; }
.av-val > span { grid-area: 1 / 1; }
.av-val [data-p-b] { opacity: 0; }

/* ---------- из v5: под строкой ---------- */
.av-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3) var(--s-4); margin-top: var(--s-4); }
.av-say { flex: 1; max-width: 640px; color: var(--soft); font-size: var(--fs-lead); line-height: 1.45; }
.av-say b { color: var(--text); font-weight: 500; }
.av-cta { display: flex; align-items: center; gap: var(--s-3); flex: none; }
.av-note { color: var(--muted); font-size: var(--fs-small); }

/* ---------- адаптив ---------- */
@media (max-width: 960px) {
  .av { --cols: minmax(0, 1fr) 40px minmax(0, 220px); }
  .av-answers { grid-template-columns: minmax(0, 1fr); max-width: 520px; gap: 10px; }
  .av-cols { display: none; }
  .av-box { margin-top: var(--s-4); }
  .av-row { row-gap: var(--s-3); }
  .av-info { grid-column: 1 / -1; }
  .av-fit { max-width: 520px; }
  .av-foot { flex-direction: column; align-items: flex-start; }
  .av-say { min-width: 0; }
}
@media (max-width: 600px) {
  /* телефон: вопрос, три чипа, сцена и результат друг под другом, кнопка. Всё на один экран */
  .av-head { margin-bottom: var(--s-2); }
  .av-lead { display: none; }
  .av-answers { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: none; gap: 8px; }
  .av-ans { justify-content: center; min-height: 48px; padding: 8px 6px; text-align: center; font-size: var(--fs-small); gap: 0; }
  .av-ans__r, .av-ans__t { display: none; }
  .av-ans__s { display: inline; }
  .av-box { margin-top: var(--s-2); }
  .av-row { grid-template-columns: minmax(0, 1fr); row-gap: 8px; padding: var(--s-2) 0; }
  /* название, «Подходит, если…» и метку убираем: способ уже выбран чипом */
  .av-info { display: contents; }
  .av-tag, .av-infos { display: none; }
  .av-replay { order: 5; justify-self: start; }
  /* провод встаёт вертикально, сайт под инструментом */
  .av-wire { justify-self: center; width: 2px; height: 14px; }
  .av-dot { left: -3px; top: -4px; }
  .av-res { height: 66px; }
  .av-res__t, .av-pr--x { display: none; }
  .av-foot { margin-top: var(--s-2); gap: 0; }
  .av-say { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .av-cta { width: 100%; flex-direction: column; gap: var(--s-1); }
  .av-cta .btn { width: 100%; }
  .av-note { text-align: center; } /* цена админки видна и на телефоне: иначе кажется, что она бесплатная */
}
@media (prefers-reduced-motion: reduce) {
  .av-i, .av-pane, .av-i.is-on, .av-pane.is-on { transition: none; }
}
