/* Мастер настройки агента. Свой набор классов, а не .ob-* из онбординга: там они завязаны
   на сцену со знаком и боковой список шагов, и одна правка там ломала бы этот экран. */

.as {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  padding-bottom: calc(var(--s-8) + env(safe-area-inset-bottom, 0px));
}

/* ---------- Top bar ---------- */
.as-top {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.as-top__inner {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  min-height: calc(64px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
}
.as-top__right { margin-left: auto; }

.as-top__inner,
.as-main { max-width: calc(680px + 2 * var(--gutter)); }
.as-main { padding-top: var(--s-5); }

/* ---------- Шаги сверху ---------- */
/* Полоски прогресса тут нет намеренно (design-system, «Принятые решения по
   движению»): четыре шага читаются по номерам, а полоска была отвергнута. */
.as-dots {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  margin: 0 0 var(--s-6);
  padding: 0;
  list-style: none;
}
.as-dots__item {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--text-3);
  font-size: var(--fs-14);
}
.as-dots__num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-size: 0.5625rem;
  line-height: 1;
}
.as-dots__num svg { width: 13px; height: 13px; }
.as-dots__item.is-current { color: var(--text); font-weight: 600; }
.as-dots__item.is-current .as-dots__num {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.as-dots__item.is-done { color: var(--text-2); }
.as-dots__item.is-done .as-dots__num { border-color: var(--success); color: var(--success); }
@media (max-width: 519px) {
  .as-dots__label { display: none; }
}

/* ---------- Шаг ---------- */
/* Высота держится минимальной, чтобы при смене шага страница не прыгала вверх-вниз. */
.as-viewport { min-height: 60dvh; }
.as-step {
  display: grid;
  gap: var(--s-4);
  align-content: start;
}
.as-step:focus { outline: none; }
.as-step__title {
  font-size: clamp(1.75rem, 5.5vw, 2.5rem);
  letter-spacing: -0.03em;
}
.as-step__lead {
  max-width: 58ch;
  color: var(--text-2);
  font-size: var(--fs-18);
  line-height: 1.6;
}
.as-step__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-2);
}
.as-fine { max-width: 62ch; color: var(--text-3); font-size: var(--fs-14); line-height: 1.6; }

.as-callout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--s-3);
  padding: var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text-2);
  line-height: 1.6;
}
.as-callout > div { display: grid; gap: var(--s-2); }
.as-callout svg { width: 18px; height: 18px; margin-top: 3px; color: var(--text-3); }
.as-callout strong { color: var(--text); }

/* ---------- Код ---------- */
.as-token {
  display: grid;
  gap: var(--s-3);
  justify-items: start;
  padding: var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.as-token__label {
  color: var(--text-3);
  font-size: var(--fs-12);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.as-token__code {
  /* Код переписывают руками в программу на компьютере: в пиксельном шрифте
     2 и Z, 5 и S неотличимы. Моноширинный — буква под буквой, без гаданий. */
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-weight: 700;
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: clamp(1.125rem, 5vw, 1.75rem);
  line-height: 1.3;
  letter-spacing: 0.06em;
  user-select: all;
}
.as-token__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* Ожидание — состояние, а не украшение: точка пульсирует тем же приёмом, что
   значок «На связи» на дашборде, и так же замирает при reduced motion. */
.as-wait {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--text-3);
  font-size: var(--fs-14);
}
.as-wait__dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
  background: var(--warning);
}
.as-wait__dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: var(--r-full);
  border: 1px solid var(--warning);
  animation: as-wait 1.8s var(--ease-out) infinite;
}
@keyframes as-wait {
  0% { opacity: 0.8; transform: scale(0.6); }
  100% { opacity: 0; transform: scale(1.4); }
}
@media (prefers-reduced-motion: reduce) {
  .as-wait__dot::after { animation: none; opacity: 0.4; }
}

.as-linked {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--success);
  border-radius: var(--r-md);
  background: var(--success-soft);
  color: var(--text);
  font-weight: 600;
}
.as-linked svg { width: 18px; height: 18px; color: var(--success); }

/* ---------- Проверки ---------- */
.as-checks {
  display: grid;
  gap: var(--s-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.as-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}
.as-check__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
  background: var(--success);
}
.as-check.is-warn .as-check__dot { background: var(--warning); }
.as-check.is-off .as-check__dot { background: var(--danger); }
.as-check__body { display: grid; gap: 2px; min-width: 0; }
.as-check__title { font-weight: 600; }
.as-check__opt { color: var(--text-3); font-weight: 400; font-size: var(--fs-12); }
.as-check__meta { color: var(--text-2); font-size: var(--fs-12); }
.as-check__state { color: var(--text-3); font-size: var(--fs-12); white-space: nowrap; }

@media (max-width: 519px) {
  .as-check { grid-template-columns: auto minmax(0, 1fr); }
  .as-check__state { grid-column: 2; }
}

/* Над шагом — маскот в состоянии агента: спит без связи, ждёт со связью. */
.as-art { max-width: 560px; margin-bottom: var(--s-5); }


/* Редизайн 3: плашка — вложенная песочная плоскость без рамки (ROADMAP §16.2). */
.as-callout { border: 0; border-radius: var(--r-lg); padding: 20px; background: var(--surface-2); }
.as-token,
.as-check { border: 0; border-radius: var(--r-lg); background: var(--surface-2); }
.as-token { padding: 20px; }
.as-linked { border: 0; border-radius: var(--r-full); }
