/* SLA controls share one button size, independent of the settings form defaults. */
.sla-auto180 {
  container: sla-auto180 / inline-size;
  min-width: 0;
  margin: 16px 0;
  padding: 18px;
  border: 1px solid #dbe7f6;
  border-radius: 14px;
  background: #fff;
  color: #253858;
}
.sla-auto180[hidden] { display: none; }
.sla-auto180 header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.sla-auto180 header > div { min-width: 0; }
.settings-center-card .sla-auto180 header h4 { margin: 0 0 6px; }
.sla-auto180 h4 { margin: 0 0 6px; font-size: 16px; }
.sla-auto180 header p,
.sla-auto180-help,
.sla-auto180-vars {
  margin: 4px 0;
  color: #65758d;
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.sla-auto180 button,
.settings-center-card .sla-auto180 button,
.settings-center-card #conversationFlow170 > button.primary {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-height: 40px;
  margin: 0;
  padding: 8px 14px !important;
  border: 1px solid #dbe7f6;
  border-radius: 10px;
  background: #f5f8fc;
  color: #265b98;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 22px;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.sla-auto180 button.primary,
.settings-center-card #conversationFlow170 > button.primary {
  background: #1769ff;
  border-color: #1769ff;
  color: #fff;
}
.settings-center-card #conversationFlow170 > button.primary {
  justify-self: end;
  width: auto;
  margin-top: 6px;
}
.sla-auto180 button:hover:not(:disabled) { background: #eaf2ff; border-color: #aac9ff; }
.sla-auto180 button.primary:hover:not(:disabled),
.settings-center-card #conversationFlow170 > button.primary:hover { background: #1258db; }
.sla-auto180 button:focus-visible,
.settings-center-card #conversationFlow170 > button.primary:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
}
.sla-auto180 button:disabled { opacity: .55; cursor: default; }
.settings-center-card .sla-auto180-check,
.sla-auto180-check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 12px 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
}
.settings-center-card .sla-auto180-check input,
.sla-auto180-check input {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #1769ff;
}
.sla-auto180-fields {
  display: grid;
  grid-template-columns: minmax(0, 280px);
  gap: 12px;
  margin: 18px 0;
}
.sla-auto180-fields label,
.sla-auto180-template { display: grid; gap: 6px; font-size: 13px; }
.sla-auto180-fields input,
.sla-auto180 textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 10px;
  border: 1px solid #dbe7f6;
  border-radius: 8px;
  font: inherit;
  background: #fff;
  color: #253858;
}
.sla-auto180 textarea { resize: vertical; line-height: 1.6; min-height: 110px; }
.sla-auto180-vars code { white-space: nowrap; font-size: 11px; }
.sla-auto180-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e7edf5;
}
.sla-auto180-notice { font-size: 12px; color: #127548; min-height: 18px; margin: 12px 0 0; }
.sla-auto180-notice.is-error { color: #b42318; }
.sla-auto180-preview {
  margin-top: 12px;
  padding: 14px;
  background: #f3f7ff;
  border: 1px solid #dbe7f6;
  border-radius: 10px;
  font-size: 13px;
}
.sla-auto180-preview p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.sla-auto180-preview small { display: block; color: #65758d; line-height: 1.6; }
.sla-auto180-history { margin-top: 20px; border-top: 1px solid #e7edf5; padding-top: 14px; }
.sla-auto180-history summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.sla-auto180-history ul { list-style: none; padding: 0; margin: 12px 0 0; }
.sla-auto180-history li { padding: 12px 0; border-bottom: 1px solid #edf1f7; font-size: 12px; }
.sla-auto180-history-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sla-auto180-history strong { overflow-wrap: anywhere; }
.sla-auto180-history small,
.sla-auto180-detail,
.sla-auto180-empty { color: #65758d; }
.sla-auto180-history p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.sla-auto180-status { padding: 3px 7px; border-radius: 20px; background: #eff4fb; white-space: nowrap; }
.sla-auto180-status[data-status=sent] { background: #e9f8ee; color: #137647; }
.sla-auto180-status[data-status=failed],
.sla-auto180-status[data-status=uncertain] { background: #fff2e5; color: #9b4e0c; }
.sla-auto180-ai { margin: 0 0 18px; padding: 16px; border: 1px solid #cddfff; border-radius: 10px; background: #f4f8ff; }
.sla-auto180-ai-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.sla-auto180-ai-head > div { min-width: 0; }
.sla-auto180-ai-head strong { font-size: 13px; }
.sla-auto180-ai-head p { margin: 6px 0; font-size: 12px; line-height: 1.6; color: #4d6385; overflow-wrap: anywhere; }
.sla-auto180-ai-head small,
.sla-auto180-ai-result small { display: block; font-size: 11px; line-height: 1.6; color: #65758d; }
.sla-auto180-ai-input { display: grid; gap: 7px; margin-top: 16px; }
.sla-auto180-ai-input label { font-size: 13px; font-weight: 600; }
.settings-center-card .sla-auto180-ai-input textarea { margin-top: 0; font-size: 13px; font-weight: 400; }
.sla-auto180-ai-input-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.sla-auto180-ai-input-meta small { color: #65758d; font-size: 11px; line-height: 1.6; }
.sla-auto180-ai-input-meta [data-sla-auto=conversation-count] { flex-shrink: 0; white-space: nowrap; }
.sla-auto180-ai-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.sla-auto180-ai-actions button { min-width: 104px; }
.sla-auto180-ai-result { margin-top: 14px; padding: 14px; border: 1px solid #dbe7f6; border-radius: 8px; background: #fff; font-size: 12px; }
.sla-auto180-ai-result[hidden] { display: none; }
.sla-auto180-ai-result strong { color: #165b3b; }
.sla-auto180-ai-result[data-result=fallback] strong,
.sla-auto180-ai-result[data-result=error] strong { color: #9b4e0c; }
.sla-auto180-ai-result p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.sla-auto180-ai-result [data-sla-auto=ai-test-meta] { margin-top: 5px; }
.sla-auto180-ai-result [data-sla-auto=ai-test-diagnostic] { font-size: 12px; color: #526580; }
.sla-auto180-ai-result [data-sla-auto=ai-test-body]:empty { display: none; }
.sla-auto180-ai-result h5 { margin: 16px 0 6px; font-size: 12px; font-weight: 600; color: #253858; }
.sla-auto180-ai-result .sla-auto180-ai-analysis p { margin: 0; }
.sla-auto180-ai-analysis[hidden],
.sla-auto180-ai-result [data-sla-auto=ai-test-body-label][hidden] { display: none; }
/* Use the card width: the settings navigation also takes space on desktop. */
@container sla-auto180 (max-width: 600px) {
  .sla-auto180-ai-head { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .sla-auto180-ai-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sla-auto180-ai-actions button { min-width: 0; }
}
@container sla-auto180 (max-width: 340px) {
  .sla-auto180-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .sla-auto180-history-top { align-items: flex-start; flex-direction: column; }
  .sla-auto180-ai { padding: 12px; }
  .sla-auto180-ai-input-meta { flex-direction: column; gap: 5px; }
}
@media (max-width: 600px) {
  .settings-center-card .settings-page[data-settings-page=sla] { min-width: 0; }
  .sla-auto180 header { gap: 10px; }
  .settings-center-card #conversationFlow170 > button.primary { justify-self: stretch; width: 100%; }
}
