/* Connectors: a full page over the city, built on the Knowledge Base page's frame and dialogs (knowledge.css).
   Layout: a header band, a note on how sign-ins are kept, your connectors as cards, then the apps to add as tiles. */
.cx-frame { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.cx-top {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: 12px 20px;
  padding: 14px 20px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.cx-title { display: grid; gap: 6px; min-width: 0; }
.cx-title h1 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 0.95; letter-spacing: .01em; }
.cx-title p { margin: 0; color: var(--muted); max-width: 64ch; }
.cx-main { overflow-y: auto; padding: 22px clamp(16px, 4vw, 48px) 48px; display: grid; align-content: start; gap: 26px; }
.cx-main > * { max-width: 1040px; }

.cx-ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cx-safe {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px;
  background: color-mix(in srgb, var(--ok) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--line));
}
.cx-safe .cx-ic { color: var(--ok); margin-top: 1px; }
.cx-safe p { margin: 0; line-height: 1.5; max-width: 86ch; }

.cx-logo {
  flex: none; width: 34px; height: 34px; border-radius: 9px; display: inline-grid; place-items: center;
  background: var(--c); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .02em;
}
.cx-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.cx-card { display: grid; gap: 8px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.cx-card-h { display: flex; gap: 10px; align-items: center; min-width: 0; }
.cx-card-name { display: grid; min-width: 0; }
.cx-card-name b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-card-name small { color: var(--muted); font-size: 12.5px; }
.cx-status, .cx-bots { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.cx-status .kb-dot { margin-left: 0; }
.cx-card .kb-doc-actions .btn { box-shadow: none; }
.cx-tools { list-style: none; margin: 0; padding: 8px 0 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.cx-tools li { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-size: 13px; }
.cx-tools .hint { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.cx-tools code { font-family: var(--font-mono); font-size: 12px; }
.cx-ro, .cx-rw { font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 999px; }
.cx-ro { background: color-mix(in srgb, var(--ok) 15%, var(--surface)); color: var(--ok); }
.cx-rw { background: color-mix(in srgb, var(--warn) 16%, var(--surface)); color: var(--warn); }

.cx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.cx-tile {
  display: grid; grid-template-rows: auto auto 1fr auto; gap: 6px; text-align: left; padding: 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg); min-width: 0;
}
.cx-tile:hover:not(:disabled) { border-color: var(--fg); }
.cx-tile:disabled { opacity: .6; cursor: default; }
.cx-tile b { font-size: 15px; }
.cx-tile span { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.cx-tile .cx-tile-go { color: var(--fg); font-weight: 700; font-size: 12.5px; }
.cx-custom { border-style: dashed; }
.cx-custom .cx-ic { width: 34px; height: 34px; padding: 6px; border-radius: 9px; background: var(--surface-2); box-sizing: border-box; }

.cx-choice { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.cx-choice > label.cx-radio {
  display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
  text-transform: none; letter-spacing: 0; font-size: 13.5px; font-weight: 400; color: var(--fg);
}
.field .cx-radio input { width: auto; flex: none; padding: 0; }
.cx-radio:has(input:checked) { border-color: var(--fg); background: var(--surface-2); }
.cx-radio input { margin-top: 3px; }
.cx-radio span { display: grid; gap: 2px; }
.cx-radio small { color: var(--muted); font-size: 12px; }

/* ---- in a bot's panel: which connectors it can use */
.bot-chat-links { display: flex; gap: 14px; min-width: 0; }
.bot-chat-links #bot-apps { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.bot-cx { display: grid; gap: 6px; }
.bot-cx-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.bot-cx-row .cx-logo { width: 26px; height: 26px; border-radius: 7px; font-size: 11px; }
.bot-cx-row b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-cx-row select { width: auto; }
.approval { display: grid; gap: 8px; padding: 10px 12px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--warn) 50%, var(--line));
  background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }
.approval p { margin: 0; }
.bot-reply .approval { margin: 6px 0; }
.approval pre { margin: 0; max-height: 160px; overflow: auto; font-family: var(--font-mono); font-size: 11.5px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .cx-top { grid-template-columns: minmax(0, 1fr); padding: 12px 16px 14px; }
  .cx-title h1 { font-size: 32px; }
  .cx-main { padding: 16px 16px 40px; }
}
