/* aiconnect.css -- Agents > Connect AI Provider…: one row per provider with a light (aiconnect.js).
 * Tokens from core.css; the card is the dialog's own (.dlgcard), only wider. */

.aic-card { max-width: min(680px, calc(100vw - 32px)); width: 680px; max-height: calc(100vh - 48px); overflow: auto; }
.aic-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 4px; }
.aic-title { margin: 0; font-size: calc(var(--ui-fs) * 18 / 13); font-weight: 600; color: var(--text-strong); }
.aic-x { background: none; border: 0; color: var(--text-dim); font-size: 22px; line-height: 1; padding: 2px 6px; border-radius: var(--radius-sm); cursor: pointer; }
.aic-x:hover { background: var(--hover); color: var(--text); }
.aic-x:focus-visible { outline: 1px solid var(--focus); outline-offset: 1px; }
.aic-lead { margin: 0 0 14px; color: var(--text-dim); line-height: 1.5; }
.aic-group { margin: 14px 0 6px; font-size: calc(var(--ui-fs) * 11 / 13); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
.aic-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.aic-row {
  display: grid; grid-template-columns: 14px minmax(13em, 1fr) auto auto; align-items: center; gap: 4px 14px;
  padding: 12px 14px; border-top: 1px solid var(--rule);
}
.aic-row:first-child { border-top: 0; }
.aic-row:hover { background: var(--hover); }
.aic-name { font-weight: 600; color: var(--text-strong); }
.aic-about { color: var(--text-dim); font-size: calc(var(--ui-fs) * 12 / 13); line-height: 1.4; margin-top: 2px; }
.aic-state { white-space: nowrap; font-size: calc(var(--ui-fs) * 12 / 13); color: var(--text-dim); max-width: 11em; overflow: hidden; text-overflow: ellipsis; }
.aic-state.on { color: var(--ok); }
.aic-state.missing { color: var(--attn); }
.aic-act { white-space: nowrap; min-width: 7.5em; text-align: center; }
.aic-act:disabled { opacity: .5; cursor: default; }

/* the transport of a provider (how the studio reaches it), and why it cannot run yet */
.aic-tr { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: calc(var(--ui-fs) * 12 / 13); }
.aic-tr-l { color: var(--text-dim); }
.aic-tr-s { max-width: 100%; min-width: 0; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: 2px 6px; }
.aic-tr-s:focus-visible { outline: 1px solid var(--focus); outline-offset: 1px; }
.aic-why { margin-top: 4px; font-size: calc(var(--ui-fs) * 11 / 13); color: var(--text-dim); line-height: 1.4; }

/* the light: green connected, a hollow ring not connected, amber not installed; a soft pulse while it is checked */
.aic-dot { width: 12px; height: 12px; border-radius: 50%; box-sizing: border-box; border: 2px solid var(--text-muted); background: transparent; }
.aic-dot.on { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.aic-dot.off { border-color: var(--text-dim); }
.aic-dot.missing { background: var(--attn); border-color: var(--attn); }
.aic-dot.unknown { border-style: dashed; }
.aic-dot.pending { animation: aic-pulse 1.2s ease-in-out infinite; }
@keyframes aic-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .aic-dot.pending { animation: none; } }

/* a phone: the state and the button under the name */
@media (max-width: 760px) {
  .aic-row, .aic-row.aic-has-det { grid-template-columns: 14px minmax(0, 1fr); }
  .aic-state, .aic-act, .aic-det-btn { grid-column: 2; justify-self: start; }
  .aic-state { max-width: 100%; }
}

/* ---- the counters of a Claude subscription (#0000-1751) ---- */
.aic-row.aic-has-det { grid-template-columns: 14px minmax(13em, 1fr) auto auto auto; }
.aic-det-btn { white-space: nowrap; }
.aic-mini { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; }
.aic-mini-i { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: calc(var(--ui-fs) * 11 / 13); color: var(--text-dim); }
.aic-mini-bar { display: inline-block; width: 64px; height: 6px; border-radius: 3px; background: var(--surface2); overflow: hidden; }
.aic-mini-bar .aic-fill { height: 100%; display: block; }
.aic-mini-p { font-variant-numeric: tabular-nums; color: var(--text); }
.aic-det .aic-detbody { margin: 6px 0 14px; }
.aic-src { margin: 0 0 14px; color: var(--text); font-weight: 600; }
.aic-meter { margin: 0 0 14px; }
.aic-mtop { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.aic-mlabel { color: var(--text); }
.aic-mpct { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-strong); }
.aic-bar { height: 10px; border-radius: 5px; background: var(--surface2); overflow: hidden; }
.aic-fill { height: 100%; border-radius: inherit; background: var(--ok); }
.aic-fill.mid { background: var(--attn); }
.aic-fill.high { background: var(--danger); }
.aic-fill.unknown { background: transparent; }
.aic-msub { margin-top: 4px; font-size: calc(var(--ui-fs) * 11 / 13); color: var(--text-dim); }
.aic-note { margin: 10px 0 0; font-size: calc(var(--ui-fs) * 12 / 13); color: var(--text-dim); }
.aic-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.aic-chip { padding: 2px 10px; border-radius: 999px; background: var(--surface2); color: var(--text); font-size: calc(var(--ui-fs) * 12 / 13); }
/* a narrower screen: name and about on top, the state and the buttons under them (after the desktop rules above, so it wins) */
@media (max-width: 760px) {
  .aic-row.aic-has-det { grid-template-columns: 14px minmax(0, 1fr); }
  .aic-det-btn { grid-column: 2; justify-self: start; }
}

/* ---- what paid AI calls cost (#0000-1757) ---- */
.aic-spent { margin-top: 6px; font-size: calc(var(--ui-fs) * 11 / 13); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.aic-tbl { width: 100%; border-collapse: collapse; margin: 0 0 12px; font-variant-numeric: tabular-nums; }
.aic-tbl td { padding: 4px 0; border-top: 1px solid var(--rule); }
.aic-tbl tr:first-child td { border-top: 0; }
.aic-tn { color: var(--text); }
.aic-tc { color: var(--text-dim); text-align: right; padding-right: 16px !important; white-space: nowrap; }
.aic-te { text-align: right; white-space: nowrap; color: var(--text-strong); }
.aic-recent { list-style: none; margin: 0 0 8px; padding: 0; }
.aic-call { display: grid; grid-template-columns: 7.5em minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; padding: 4px 0; border-top: 1px solid var(--rule); font-size: calc(var(--ui-fs) * 12 / 13); }
.aic-call:first-child { border-top: 0; }
.aic-when { color: var(--text-dim); white-space: nowrap; }
.aic-who, .aic-what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aic-what { color: var(--text-dim); }
.aic-fail .aic-what { color: var(--attn); }
@media (max-width: 560px) { .aic-call { grid-template-columns: minmax(0, 1fr) auto; } .aic-when, .aic-what { display: none; } }

/* the order of use (#0000-2367) */
.aic-olist { list-style: none; margin: 4px 0 0; padding: 0; }
.aic-orow { display: flex; align-items: center; gap: 10px; padding: 6px 4px; cursor: grab; }
.aic-orow.aic-off { opacity: .6; }
.aic-onr { width: 1.5em; text-align: center; font-variant-numeric: tabular-nums; }
.aic-oname { flex: 1; }
.aic-oup, .aic-odown { padding: 2px 8px; }

/* the Claude subscriptions of the own studio (#0000-3436) */
.aic-slist { list-style: none; margin: 4px 0 0; padding: 0; }
.aic-srow { display: flex; align-items: flex-start; gap: 8px; padding: 8px 4px; border-top: 1px solid var(--rule); }
.aic-srow:first-child { border-top: 0; }
.aic-smain { flex: 1; min-width: 0; }
.aic-stop { display: flex; align-items: center; gap: 8px; }
.aic-sname { color: var(--text-strong); }
.aic-stail { color: var(--text-dim); font-family: var(--mono, monospace); font-size: calc(var(--ui-fs) * 12 / 13); }
.aic-sdesc, .aic-sinfo { color: var(--text-dim); font-size: calc(var(--ui-fs) * 12 / 13); overflow-wrap: anywhere; }
.aic-sinfo.works { color: var(--ok, var(--text-dim)); }
.aic-sinfo.limit, .aic-sinfo.refused { color: var(--attn); }
.aic-sinput { width: 100%; box-sizing: border-box; }
.aic-sedrow { display: flex; gap: 6px; margin: 2px 0; }
.aic-scmd { overflow-wrap: anywhere; }
