/* Site management → «Настройки» and «Интеграции» presentation: collapsible
   summary layout, the "настроить через ИИ / в кабинете" hint, and the field
   groups that replace native <fieldset>/<legend> (whose legend overlaps the
   border in the OS font). Tokens only. See docs/DESIGN-SYSTEM.md. */

details.collapsible.section {
  background: var(--color-bg-card);
  margin-bottom: 16px;
}

/* Summary: title on the left, status pill + chevron grouped on the right. */
details.collapsible > summary > .collapsible-summary__aside {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

details.collapsible > summary .chevron {
  width: 20px;
  height: 20px;
}

/* A nested collapsible (e.g. Bitrix24 «Расширенные настройки») sits flush
   inside a body without doubling the outer margin. */
.collapsible-body > details.collapsible {
  margin: 16px 0 0;
}
.collapsible-body > details.collapsible:first-child {
  margin-top: 0;
}

/* "Настроить через ИИ или в кабинете" hint. */
.lidfly-manage-hint {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-element);
  background: var(--color-bg-subtle);
  color: var(--color-text-secondary);
  font-size: var(--text-base);
  line-height: 1.5;
}
.lidfly-manage-hint svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--color-brand-text);
}
.lidfly-manage-hint strong {
  color: var(--color-text);
  font-weight: 650;
}

/* Field groups replacing native <fieldset>/<legend>. */
.lidfly-field-group {
  border: 0;
  padding: 0;
  margin: 0 0 22px;
}
.lidfly-field-group:last-of-type {
  margin-bottom: 0;
}
.lidfly-field-group__title {
  margin: 0 0 12px;
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
}
.lidfly-field-group__note {
  margin: -4px 0 12px;
}

/* Unify control heights across the settings forms: the custom select (48px),
   native inputs, and buttons share one height and one font size. Many settings
   inputs carry no `type` attribute, so app.css's `input[type=...]` rules miss
   them and they render browser-default — normalize them here. */
.site-product-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]) {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-element);
  background: var(--color-bg-card);
  color: var(--color-text);
  font: inherit;
  font-size: var(--text-base);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.site-product-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]):focus {
  outline: none;
  border-color: var(--color-brand-text);
}

/* Semantic status-pill tones. `.is-active` (green) stays the "done" state;
   these add attention (amber), risk (red) and an explicit neutral so a glance
   tells "done / needs attention / problem / not set". Tokens only. */
.site-status-pill--action {
  color: var(--color-warning-text);
  border-color: var(--color-warning-border);
  background: var(--color-warning-bg);
}
.site-status-pill--risk {
  color: var(--color-error);
  border-color: color-mix(in srgb, var(--color-error) 34%, transparent);
  background: color-mix(in srgb, var(--color-error) 10%, transparent);
}
.site-status-pill--off {
  color: var(--color-text-muted);
}

/* Integration cards (Bitrix24, MANGO) become collapsible status strips: the
   card header is the summary, the body reveals on expand. */
details.lidfly-integration-card {
  border-radius: var(--radius-card);
}
details.lidfly-integration-card > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--color-bg-card);
}
details.lidfly-integration-card > summary:hover {
  background: var(--color-bg-subtle);
}
details.lidfly-integration-card[open] > summary {
  border-bottom: 1px solid var(--color-border);
}
.lidfly-integration-card__aside {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Nested «Расширенные настройки» inside the Bitrix24 form. */
#lidfly-bitrix24-advanced {
  margin: 16px 0 4px;
}
