/* Стили, специфичные для статьи «Чат-бот отвечает, агент делает». Общие компоненты — в shared/css. */

/* ---------- Окно агента: строки инструментов ---------- */

.ca-term { font-family: var(--font-mono); font-size: 13px; line-height: 1.5; }
.ca-term .window__body { display: grid; gap: 6px; padding: 14px 16px; align-content: start; }
.ca-ask { color: var(--text); padding-bottom: 6px; }
.ca-ask::before { content: '> '; color: var(--muted); }

.ca-line { display: flex; gap: 8px; align-items: baseline; min-width: 0; animation: demo-in .3s var(--ease-out) both; }
.ca-line::before { content: '⏺'; flex: none; font-size: 10px; color: var(--mint-fg); }
.ca-line b { font-weight: 600; flex: none; }
.ca-line span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ca-line--think::before { color: var(--primary-fg); }
.ca-line--think span, .ca-line--ok span, .ca-line--err span { white-space: normal; }
.ca-line--think span { color: var(--text); }
.ca-line--wait::before { color: var(--signal-fg); }
.ca-line--err::before { color: var(--danger); }
.ca-line--err span { color: var(--danger); }
.ca-line--ok span { color: var(--mint-fg); }

/* ---------- Кто делает шаг: вы / модель / агент ---------- */

.ca-who {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 99px;
  font-family: var(--font-heading);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--muted);
}
.ca-who::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ca-who--you { background: color-mix(in srgb, var(--signal) 16%, transparent); color: var(--signal-fg); }
.ca-who--agent { background: var(--mint-soft); color: var(--mint-fg); }
.ca-who--model { background: var(--primary-soft); color: var(--primary-fg); }
.ca-who--bad { background: var(--danger-soft); color: var(--danger); }

/* ---------- Мини-сайт кофейни ---------- */

.ca-site {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  font-size: 12px;
  line-height: 1.35;
}
.ca-site__bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.ca-site__bar i { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); }
.ca-site__bar span { margin-left: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca-site__viewport { padding: 10px; transition: padding var(--transition); }
.ca-site__page {
  margin: 0 auto;
  max-width: 100%;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  overflow: visible;
  transition: max-width .4s var(--ease-out);
}
.ca-site--narrow .ca-site__page { max-width: 150px; }
.ca-site__nav { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.ca-site__nav b { font-family: var(--font-heading); font-weight: 600; font-size: 12px; white-space: nowrap; }
.ca-site__nav span { color: var(--muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ca-site--narrow .ca-site__nav span { display: none; }
.ca-site__hero { padding: 10px 10px 4px; }
.ca-site__h { font-family: var(--font-heading); font-weight: 500; font-size: 14px; line-height: 1.15; }
.ca-site__p { color: var(--muted); font-size: 11px; margin-top: 3px; }
.ca-site__slot { padding: 8px 10px 10px; min-height: 108px; display: grid; }
.ca-site__empty {
  display: grid;
  place-items: center;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  padding: 8px;
}
.ca-site__form { display: grid; gap: 5px; align-content: start; position: relative; }
.ca-site__label { font-weight: 600; font-size: 11.5px; }
.ca-site__field {
  display: block;
  padding: 4px 7px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
}
.ca-site__btn {
  display: block;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 11.5px;
  transition: transform .4s var(--ease-out), width .4s var(--ease-out);
}
.ca-site__btn--broken {
  width: 150%;
  outline: 2px dashed var(--danger);
  outline-offset: 2px;
}
.ca-site__toast { margin-top: 2px; padding: 4px 7px; border-radius: 6px; font-size: 11px; font-weight: 500; }
.ca-site__toast--ok { background: var(--mint-soft); color: var(--mint-fg); }
.ca-site__toast--err { background: var(--danger-soft); color: var(--danger); }
.ca-site__console {
  padding: 7px 10px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ca-site__console--err { color: var(--danger); background: var(--danger-soft); }
.ca-site__console--ok { color: var(--mint-fg); }

/* ---------- Чат заявок в Telegram ---------- */

.ca-tg { border-radius: 14px; border: 1px solid var(--border); background: var(--surface); overflow: hidden; font-size: 12px; }
.ca-tg__head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.ca-tg__head i { width: 22px; height: 22px; border-radius: 50%; background: var(--primary); flex: none; }
.ca-tg__head b { display: block; font-family: var(--font-heading); font-weight: 500; font-size: 12px; }
.ca-tg__head span { display: block; color: var(--muted); font-size: 10.5px; }
.ca-tg__list { display: grid; gap: 6px; padding: 10px; min-height: 52px; align-content: start; }
.ca-tg__empty { color: var(--muted); font-size: 11px; text-align: center; padding: 6px 0; }
.ca-tg__msg { justify-self: start; max-width: 100%; padding: 6px 9px; border-radius: 10px 10px 10px 4px; background: var(--panel); border: 1px solid var(--border); }
.ca-tg__msg b { display: block; font-weight: 600; font-size: 11.5px; }
.ca-tg__msg span { color: var(--muted); font-size: 11px; }

/* ---------- Раскладка «лог слева, сайт справа» ---------- */

.ca-split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.ca-side { display: grid; gap: 10px; }
@media (max-width: 720px) { .ca-split { grid-template-columns: 1fr; } }

/* ---------- Hero: один запрос — чат отвечает текстом, агент меняет сайт ---------- */

.hero__visual { display: flex; align-items: center; justify-content: center; }
.hero-ca { width: 100%; max-width: 440px; display: grid; gap: 10px; }
.hero-ca__ask {
  justify-self: end;
  max-width: 88%;
  padding: 9px 13px;
  border-radius: 14px 14px 4px 14px;
  background: var(--primary);
  color: #fff;
  font-size: 13.5px;
  line-height: 1.4;
  box-shadow: var(--shadow);
}
.hero-ca__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hero-ca__card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  min-height: 236px;
  min-width: 0;
}
.hero-ca__title { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.hero-ca__text { font-size: 12.5px; line-height: 1.45; color: var(--text); }
.hero-ca__code {
  margin: 0;
  padding: 8px 9px;
  border-radius: 8px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--muted);
  white-space: pre;
  overflow: hidden;
}
.hero-ca__next { font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.hero-ca__lines { display: grid; gap: 4px; font-family: var(--font-mono); font-size: 11px; }
.hero-ca__foot { margin-top: auto; }
.hero-ca .ca-site { font-size: 11px; }
.hero-ca .ca-site__slot { min-height: 0; }
.hero-ca .ca-site__console { display: none; }
@media (max-width: 420px) {
  .hero-ca__pair { grid-template-columns: 1fr; }
  .hero-ca__card { min-height: 0; }
}
