/* AI provider settings, the provider pill and the first-run note. Tokens only (style.css). */

.settings-modal { max-width: 46rem; }
.settings-modal .modal-body { max-height: calc(100dvh - 48px); overflow-y: auto; }

.pcards-wrap { border: 0; margin: 0; padding: 0; min-width: 0; }
.pcards-wrap legend { margin-bottom: var(--s-2); }
.pcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
.pcard {
  position: relative; display: flex; flex-direction: column; gap: 4px; cursor: pointer;
  padding: var(--s-3); border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border);
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.pcard:hover { border-color: var(--border-strong); }
.pcard.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.pcard:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.pcard-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); flex-wrap: wrap; }
.pcard-title { font-weight: 600; font-size: var(--fs-md); color: var(--text); }
.pcard-blurb { font-size: var(--fs-xs); color: var(--text-2); line-height: 1.45; }

.pbadge {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 600; white-space: nowrap;
  background: var(--sunken); color: var(--text-2);
}
.pbadge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pbadge.ok { color: var(--ok); }
.pbadge.busy { color: var(--accent-text); background: var(--surface); }
.pbadge.bad { color: var(--danger); background: var(--danger-soft); }
.pbadge.idle { color: var(--text-3); }

.pdetails { border-top: 1px solid var(--border); padding-top: var(--s-4); }
.ppanel { display: flex; flex-direction: column; gap: var(--s-3); }
.ppanel .field { margin: 0; }
.ppanel .hint { margin-top: 0; }
.hint.ok, .ptest.ok { color: var(--ok); }
.prow { display: flex; gap: var(--s-2); align-items: center; }
.prow .input { flex: 1; min-width: 0; }

.pchoice { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pchoice legend { margin-bottom: 6px; }
.pchoice-opt { display: flex; gap: var(--s-2); align-items: flex-start; font-size: var(--fs-sm); color: var(--text-2); cursor: pointer; }
.pchoice-opt input { accent-color: var(--accent); margin-top: 3px; flex-shrink: 0; }
.pchoice-opt strong { color: var(--text); font-weight: 600; }

.pactions { display: flex; flex-wrap: wrap; gap: var(--s-2); }

.ptest { margin: 0; font-size: var(--fs-xs); }
.ptest.err { color: var(--danger); }
.ptest-fail { display: flex; flex-direction: column; gap: var(--s-2); margin-top: 6px; }
.pfix { display: flex; flex-direction: column; gap: 6px; padding: var(--s-3); border-radius: var(--r-md); background: var(--panel); border: 1px solid var(--border); }
.pfix-title { margin: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.pfix-cmd { display: flex; gap: var(--s-2); align-items: flex-start; }
.pfix-cmd pre {
  flex: 1; min-width: 0; margin: 0; padding: var(--s-2) var(--s-3); overflow-x: auto;
  font-family: var(--mono); font-size: var(--fs-xs); line-height: 1.5; white-space: pre;
  background: var(--sunken); color: var(--text); border-radius: var(--r-sm);
}

/* The active provider, next to the Ask box and the chat composer. */
.provider-row { display: flex; padding: 0 var(--s-1); min-width: 0; }
.chat-panel .provider-row { padding: var(--s-2) var(--s-4) 0; }
.ppill {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0;
  padding: 2px 10px; border-radius: var(--r-pill); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); font: inherit; font-size: var(--fs-xs); cursor: pointer;
}
.ppill:hover { border-color: var(--border-strong); color: var(--text); }
.ppill:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.ppill-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ppill-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--text-3); }
.ppill-dot.ok { background: var(--ok); }
.ppill-dot.busy { background: var(--accent); }
.ppill-dot.bad { background: var(--danger); }

/* First run: no provider answers. */
.pnudge {
  display: flex; flex-direction: column; gap: var(--s-2); margin: var(--s-2) 0;
  padding: var(--s-3); border-radius: var(--r-md);
  background: var(--warn-soft); color: var(--warn-text); border: 1px solid var(--border);
}
.chat-scroll > .pnudge { margin: var(--s-3) var(--s-4) 0; }
.pnudge-text { margin: 0; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.pnudge .btn-outline { background: var(--surface); }

@media (max-width: 767px) {
  .pcards { grid-template-columns: 1fr; }
  .settings-modal .modal-body { padding: var(--s-4); }
  .prow { flex-wrap: wrap; }
  .prow .input { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .pcard { transition: none; }
}
