/* v2-widget.css — срез 54W «Чат на сайте»: экран настроек виджета (#/bot/<id>/widget).
 * Только токены дизайн-системы v2 (tokens.css); коралл — только главные кнопки (Сохранить / Скопировать код). */

.bwg { display: flex; flex-direction: column; gap: 16px; padding: 8px 0 24px; min-width: 0; }
.bwg-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bwg-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.bwg-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@media (min-width: 900px) {
  .bwg-grid { grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; }
  .bwg-col--side { position: sticky; top: 16px; }
}

.bwg-card {
  display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); min-width: 0;
}
.bwg-card__title { margin: 0; font-size: 16px; line-height: 22px; font-weight: var(--weight-semibold); color: var(--text); }

.bwg-status { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bwg-status__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bwg-status__title { font-size: 16px; line-height: 22px; font-weight: var(--weight-semibold); color: var(--text); }
.bwg-state { margin: 0; font-size: 14px; line-height: 20px; color: var(--text-muted); }
.switch[disabled] { opacity: .45; cursor: not-allowed; }

.bwg-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bwg-field__label { font-size: 14px; line-height: 20px; font-weight: var(--weight-medium); color: var(--text); }
.bwg-input.text-input { min-height: 44px; padding: 0 12px; font-size: 16px; width: 100%; box-sizing: border-box; }
.bwg-greet { min-height: 64px; }

.bwg-domains { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bwg-domain {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 6px 0 12px; border-radius: 10px;
  background: var(--surface-sunken); color: var(--text); font-size: 15px; min-width: 0;
}
.bwg-domain .icon { width: 18px; height: 18px; color: var(--text-faint); flex: none; }
.bwg-domain__name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.bwg-domain--empty { color: var(--text-faint); background: transparent; border: 1px dashed var(--border-strong); }
.bwg-domain__del {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-muted); cursor: pointer;
}
.bwg-domain__del .icon { width: 18px; height: 18px; }
.bwg-domain__del:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
@media (hover: hover) and (pointer: fine) { .bwg-domain__del:hover { background: var(--surface-hover); color: var(--danger); } }
.bwg-add { display: flex; gap: 8px; align-items: stretch; }
.bwg-add .bwg-input { flex: 1 1 auto; min-width: 0; }
.bwg-add .btn { flex: none; min-height: 44px; padding: 0 14px; border-radius: 10px; }

.bwg-swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.bwg-sw {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--surface); background: var(--sw);
  box-shadow: 0 0 0 1px var(--border-strong); cursor: pointer; padding: 0;
}
.bwg-sw.is-on { box-shadow: 0 0 0 2px var(--text); }
.bwg-sw:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--text), var(--shadow-focus); }
.bwg-color {
  width: 44px; height: 36px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface);
  padding: 2px; cursor: pointer;
}

.bwg-save { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bwg-save .btn { min-height: 48px; padding: 0 22px; }
.bwg-save__hint { color: var(--text-muted); }

.bwg-code {
  margin: 0; padding: 12px; border-radius: 10px; background: var(--surface-sunken); border: 1px solid var(--border);
  overflow-x: auto; max-width: 100%;
}
.bwg-code__txt { font-family: var(--font-mono); font-size: 13px; line-height: 18px; color: var(--text); white-space: pre-wrap; word-break: break-all; }
.bwg-acts { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.bwg-acts .btn { min-height: 44px; padding: 0 16px; border-radius: 10px; }

.bwg-how { border-top: 1px solid var(--border); padding-top: 10px; }
.bwg-how summary {
  cursor: pointer; min-height: 40px; display: flex; align-items: center; font-size: 15px; font-weight: var(--weight-medium);
  color: var(--text); list-style-position: inside;
}
.bwg-how summary:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: 8px; }
.bwg-how__body h3 { margin: 10px 0 2px; font-size: 14px; line-height: 20px; font-weight: var(--weight-semibold); color: var(--text); }
.bwg-how__body p { margin: 0 0 6px; font-size: 14px; line-height: 20px; color: var(--text-muted); overflow-wrap: anywhere; }

.bwg-install {
  margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 14px; line-height: 20px;
  background: var(--surface-sunken); color: var(--text-muted); overflow-wrap: anywhere;
}
.bwg-install.is-ok { background: var(--st-won-bg); color: var(--st-won-fg); }
.bwg-install.is-warn { background: var(--st-work-bg); color: var(--st-work-fg); }

/* Предпросмотр: «сайт» в серых тонах, поверх — настоящий widget.js (Shadow DOM, режим preview). */
.bwg-stage {
  position: relative; height: 560px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border);
  background:
    linear-gradient(var(--surface-sunken) 0 0) 16px 18px / 45% 14px no-repeat,
    linear-gradient(var(--surface-sunken) 0 0) 16px 46px / 70% 10px no-repeat,
    linear-gradient(var(--surface-sunken) 0 0) 16px 66px / 60% 10px no-repeat,
    var(--surface);
}
@media (max-width: 899px) { .bwg-stage { height: 520px; } }

/* 57C1: пока чат выключен — код приглушён и сверху подсказка «сначала сайт и включение» */
.bwg-code__lock { color: var(--text); font-weight: var(--weight-medium); }
.bwg-code__lock[hidden] { display: none; }
.is-locked .bwg-code { opacity: .5; }

/* docs/67 П3: «Внешний вид» / «Как выглядит на сайте» / «Код и проверка установки» — оглавление + аккордеон
   (js/v2/accordion.js; общие стили .acc-* — в v2-knowledge.css). */
.bwg-col[hidden], .acc-row[hidden] { display: none; }
.bwg-acc { display: flex; flex-direction: column; gap: 12px; padding: 16px; min-width: 0; }
.bwg-sub { margin: 8px 0 0; font-size: 15px; line-height: 22px; font-weight: var(--weight-semibold); color: var(--text); }
.bwg-panel .bwg-save { margin-top: 4px; }
.bwg-panel .bwg-how { margin-top: 4px; }
