/* AI provider settings ------------------------------------------------ */

.ai-settings-layout {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    minmax(260px, 330px);
  gap: 20px;
  align-items: start;
}

.ai-settings-layout > main {
  min-width: 0;
}

.ai-settings-card + .ai-settings-card {
  margin-top: 18px;
}

.ai-settings-provider-badge {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  padding: 9px 11px;
  background: #f7fafb;
  border: 1px solid #dce6ea;
  border-radius: 10px;
}

.ai-settings-provider-badge > span {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  background: #c79a42;
  border-radius: 50%;
}

.ai-settings-provider-badge.is-ready > span {
  background: #38a56b;
  box-shadow:
    0 0 0 4px
    rgba(56, 165, 107, .1);
}

.ai-settings-provider-badge strong,
.ai-settings-provider-badge small {
  display: block;
}

.ai-settings-provider-badge strong {
  color: #263f4c;
  font: 600 .62rem "Work Sans", sans-serif;
}

.ai-settings-provider-badge small {
  margin-top: 2px;
  color: #87979e;
  font: 500 .52rem "Work Sans", sans-serif;
}

.ai-settings-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #e2e9ec;
}

.ai-settings-connection {
  display: grid;
  border: 1px solid #e1e8eb;
  border-radius: 11px;
  overflow: hidden;
}

.ai-settings-status-row {
  display: grid;
  grid-template-columns: minmax(150px, .45fr) 1fr;
  gap: 14px;
  align-items: center;
  padding: 11px 13px;
  border-top: 1px solid #e6edef;
}

.ai-settings-status-row:first-child {
  border-top: 0;
}

.ai-settings-status-row > span {
  color: #7b8e96;
  font: 500 .58rem "Work Sans", sans-serif;
}

.ai-settings-status-row strong,
.ai-settings-status-row code {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ai-settings-status-row strong {
  color: #263f4c;
  font: 600 .62rem "Work Sans", sans-serif;
}

.ai-settings-status-row code {
  color: #054d7f;
  background: #edf4f6;
  border-radius: 5px;
  padding: 4px 6px;
  font-size: .56rem;
}

.ai-settings-test-row {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 14px;
}

.ai-settings-test-row p {
  margin: 0;
  color: #7f9097;
  font: 400 .57rem/1.45 "Work Sans", sans-serif;
}

.ai-settings-help {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
}

.ai-settings-help h3 {
  margin: 4px 0 8px;
  color: #032e4d;
  font: 600 1rem "Barlow", sans-serif;
}

.ai-settings-help > section > p:not(.admin-section-kicker) {
  color: #71858e;
  font: 400 .62rem/1.55 "Work Sans", sans-serif;
}

.ai-settings-help dl {
  margin-top: 15px;
}

.ai-settings-help dl > div {
  padding: 10px 0;
  border-top: 1px solid #e5ecef;
}

.ai-settings-help dt {
  margin-bottom: 4px;
  color: #8a999f;
  font: 500 .52rem "Work Sans", sans-serif;
}

.ai-settings-help dd {
  margin: 0;
  color: #314c59;
  font: 600 .58rem/1.45 "Work Sans", sans-serif;
  overflow-wrap: anywhere;
}

.ai-settings-help code {
  color: #054d7f;
  background: #edf4f6;
  border-radius: 5px;
  padding: 3px 5px;
  font-size: .54rem;
}

.ai-settings-security-note {
  border-left: 3px solid #04a0dd;
}

.geo-ai-settings-link {
  margin-left: 7px;
  font-weight: 600;
}

@media screen and (max-width: 1000px) {
  .ai-settings-layout {
    grid-template-columns: 1fr;
  }

  .ai-settings-help {
    position: static;
  }
}

@media screen and (max-width: 620px) {
  .ai-settings-status-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .ai-settings-test-row {
    align-items: flex-start;
    flex-direction: column;
  }
}
