/* Connections page and the "Add from your apps" picker. Locked design system: Fynn-style cards, copper brand,
   selected states on the soft warm grey (--sel) with ink text, never black. */
.conn2 { --cx-sel: var(--sel, #ece8e4); }
.cx-lead { display: flex; gap: 10px; align-items: flex-start; margin: -4px 0 20px; padding: 12px 14px; border-radius: 14px; background: var(--panel); box-shadow: var(--shadow-1); font-size: 13px; line-height: 1.5; color: var(--ink-2); max-width: 900px; }
.cx-lead svg { flex: none; color: var(--brand); margin-top: 2px; }
.cx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.cx-card { display: flex; flex-direction: column; gap: 12px; min-height: 248px; padding: 18px; border-radius: 20px; background: var(--panel); box-shadow: var(--shadow-card); min-width: 0; contain: layout paint style; transition: box-shadow .25s var(--ease), transform .25s var(--ease); }
.cx-card:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0,0,0,.03), 0 16px 36px -18px rgba(0,0,0,.18); }
.cx-card.on { box-shadow: var(--shadow-card), inset 0 0 0 1.5px rgba(224,104,47,.35); }
.cx-skel { background: linear-gradient(90deg, var(--panel), var(--hover), var(--panel)); background-size: 200% 100%; animation: cxSk 1.2s linear infinite; }
@keyframes cxSk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.cx-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.cx-state { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12px; white-space: nowrap; background: var(--hover); color: var(--ink-2); }
.cx-state.on { background: rgba(47,125,79,.12); color: #2f7d4f; }
.cx-state.on i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cx-state.keys { color: var(--ink-3); }
.cx-name { min-width: 0; }
.cx-name b { display: block; font: 500 17px/1.25 var(--display); letter-spacing: -.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-name small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-scopes { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
.cx-scopes li { display: flex; gap: 6px; align-items: center; min-width: 0; }
.cx-scopes svg { width: 13px; height: 13px; flex: none; color: var(--ink-3); }
.cx-keys { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.cx-keys summary { cursor: pointer; color: var(--ink); font-weight: 500; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.cx-keys summary::-webkit-details-marker { display: none; }
.cx-keys summary::before { content: '+'; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; background: var(--hover); font-size: 12px; }
.cx-keys[open] summary::before { content: '–'; }
.cx-keys p { margin: 8px 0; }
.cx-keys code { font: 11.5px/1.4 var(--mono, ui-monospace, monospace); background: var(--hover); padding: 1px 5px; border-radius: 5px; word-break: break-all; }
.cx-copy { display: flex; align-items: center; gap: 6px; background: var(--hover); border-radius: 10px; padding: 4px 4px 4px 10px; min-width: 0; }
.cx-copy code { background: transparent; padding: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; word-break: normal; }
.cx-f { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* picker */
.cx-pick-wrap { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; }
.cx-scrim { position: absolute; inset: 0; background: rgba(15,15,16,.32); animation: cxFade .2s var(--ease); }
.cx-pick { position: relative; width: min(560px, 100%); max-height: min(640px, calc(100vh - 32px)); display: flex; border-radius: 22px; background: var(--panel); box-shadow: 0 30px 80px -24px rgba(0,0,0,.4); overflow: hidden; animation: cxIn .25s var(--ease); }
.cx-pick-in { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
@keyframes cxFade { from { opacity: 0; } }
@keyframes cxIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.cx-ph { display: flex; align-items: center; gap: 8px; padding: 14px 12px 10px 18px; }
.cx-ph b { font: 500 16px var(--display); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-apps { display: grid; gap: 4px; padding: 4px 10px 14px; overflow-y: auto; }
.cx-apps button { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; text-align: left; color: inherit; transition: background-color .15s var(--ease); }
.cx-apps button:hover, .cx-apps button:focus-visible { background: var(--cx-sel, var(--hover)); }
.cx-apps .tn { flex: 1; min-width: 0; }
.cx-apps b { display: block; font-weight: 500; font-size: 14px; }
.cx-apps small { display: block; font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-apps > button > svg { color: var(--ink-3); flex: none; }
.cx-none { display: grid; justify-items: center; gap: 10px; padding: 28px 18px 32px; text-align: center; color: var(--ink-3); }
.cx-none p { margin: 0; font-size: 13.5px; }
.cx-search { position: relative; margin: 0 14px 8px; }
.cx-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.cx-search input { width: 100%; height: 40px; border-radius: 12px; border: 0; background: var(--hover); padding: 0 12px 0 36px; font: inherit; font-size: 13.5px; color: var(--ink); outline: none; }
.cx-search input:focus { box-shadow: inset 0 0 0 1.5px var(--line-2); }
.cx-files { flex: 1; min-height: 160px; overflow-y: auto; padding: 0 8px; overscroll-behavior: contain; }
.cx-file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; cursor: pointer; transition: background-color .15s var(--ease); }
.cx-file:hover { background: var(--hover); }
.cx-file.on { background: var(--cx-sel, var(--hover)); color: var(--ink); }
.cx-file input { width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
.cx-ft { width: 28px; height: 28px; border-radius: 8px; flex: none; display: grid; place-items: center; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-3); font-size: 15px; }
.cx-ft img { width: 16px; height: 16px; }
.cx-file .tn { flex: 1; min-width: 0; }
.cx-file b { display: block; font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-file small { display: block; font-size: 12px; color: var(--ink-3); }
.cx-wait, .cx-err { margin: 18px 12px; font-size: 13px; color: var(--ink-3); }
.cx-err { color: var(--bad, #c0392b); }
.cx-pf { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); font-size: 12.5px; }
@media (max-width: 600px) {
  .cx-pick-wrap { place-items: end stretch; padding: 0; }
  .cx-pick { width: 100%; max-height: 88vh; border-radius: 22px 22px 0 0; }
  .cx-card { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) { .cx-scrim, .cx-pick, .cx-skel { animation: none; } }
