/* Conector: integraciones, claves, webhooks y documentación de la API. */

.cx-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.inline-form { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.page-header__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.panel__footer.form-actions { flex-wrap: wrap; }
details summary { cursor: pointer; color: var(--muted); }

.cx-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 18px; }
.cx-tabs a { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 13.5px; }
.cx-tabs a:hover { color: var(--text); border-color: var(--line-strong); }
.cx-tabs a.is-active { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.cx-tabs .icon { font-size: 18px; }

.cx-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; }
.cx-base { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; }
.cx-base code { padding: 6px 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }

.cx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cx-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface); color: var(--text); min-width: 0; }
a.cx-card:hover { border-color: var(--accent); color: var(--text); }
.cx-card__top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cx-card__icon { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.cx-card__icon .icon { font-size: 22px; }
.cx-card__title { font-weight: 700; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-card__meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px 12px; flex-wrap: wrap; }
.cx-card p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.cx-card--add { border-style: dashed; }

.cx-secret { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--radius-lg); background: var(--warn-soft); border: 1px solid var(--warn); }
.cx-secret strong { display: flex; align-items: center; gap: 8px; }
.cx-secret__row { display: flex; gap: 8px; align-items: stretch; }
.cx-secret__row input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; }

.cx-section-title { margin: 6px 0 0; font-size: 16px; font-weight: 700; }
.cx-error { color: var(--danger); font-size: 12.5px; overflow-wrap: anywhere; }
.cx-small { font-size: 12.5px; color: var(--muted); }

/* --- documentación pública (/api/v1/docs) --- */
.cx-public { background: var(--bg); color: var(--text); margin: 0; }
.cx-public__head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.cx-public__brand img { height: 28px; width: auto; display: block; }
.cx-public__title { flex: 1; font-weight: 700; color: var(--muted); }
.cx-public__main { max-width: 1180px; margin: 0 auto; padding: 28px 24px 64px; }
.cx-public .cx-toc { top: 72px; }

/* --- documentación ---------------------------------------------------------------------- */
.cx-docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.cx-toc { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.cx-toc a { padding: 6px 10px; border-radius: 8px; color: var(--muted); }
.cx-toc a:hover { background: var(--hover); color: var(--text); }
.cx-toc strong { margin: 12px 10px 4px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
.cx-doc { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.cx-doc section { scroll-margin-top: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cx-doc h2 { margin: 0; font-size: 20px; }
.cx-doc h3 { margin: 6px 0 0; font-size: 16px; }
.cx-doc p, .cx-doc li { font-size: 14px; line-height: 1.65; margin: 0; }
.cx-doc ul, .cx-doc ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.cx-doc code { font-family: var(--mono); font-size: 0.9em; padding: 1px 5px; border-radius: 5px; background: var(--surface-2); overflow-wrap: anywhere; }

/* Ejemplos de código como un editor oscuro (colores del tema Dark+ de VS Code), igual en modo claro y oscuro. */
.cx-code { min-width: 0; overflow: hidden; border: 1px solid #2b2b2b; border-radius: var(--radius); background: #1e1e1e; color: #d4d4d4; color-scheme: dark; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18); }
.cx-code__bar { display: flex; align-items: stretch; background: #252526; overflow-x: auto; scrollbar-width: none; }
.cx-code__bar::-webkit-scrollbar { display: none; }
.cx-code__bar [data-code-tab] { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 16px; border: none; border-right: 1px solid #252526; background: #2d2d2d; color: #969696; font-family: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: color 0.15s; }
.cx-code__bar [data-code-tab]:hover { color: #cccccc; }
.cx-code__bar [data-code-tab][aria-selected="true"] { background: #1e1e1e; color: #ffffff; box-shadow: inset 0 1px 0 #0078d4; }
.cx-code__bar [data-code-tab]:focus-visible { outline: 1px solid #0078d4; outline-offset: -1px; }
.cx-code__bar [data-code-tab]::before { font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: -0.02em; }
.cx-code__bar [data-code-tab="python"]::before { content: "py"; color: #519aba; }
.cx-code__bar [data-code-tab="node"]::before { content: "JS"; color: #cbcb41; }
.cx-code__bar [data-code-tab="php"]::before { content: "php"; color: #a074c4; }
.cx-code__bar [data-code-tab="curl"]::before { content: "$_"; color: #8dc149; }
.cx-code__bar [data-code-tab="json"]::before { content: "{}"; color: #cbcb41; }
.cx-code__bar .grow { flex: 1; min-width: 12px; }
.cx-code__bar [data-code-copy] { position: sticky; right: 0; align-self: center; height: 26px; margin-right: 6px; padding: 0 10px; border: none; border-radius: 5px; background: #252526; box-shadow: -10px 0 10px #252526; color: #cccccc; font-family: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.cx-code__bar [data-code-copy]:hover { background: #37373d; }
.cx-code pre { margin: 0; padding: 12px 0 14px; overflow-x: auto; background: #1e1e1e; color: #d4d4d4; font-family: Consolas, "Cascadia Code", "Cascadia Mono", Menlo, "DejaVu Sans Mono", var(--mono), monospace; font-size: 13px; line-height: 19px; white-space: pre; tab-size: 4; counter-reset: cx-line; scrollbar-color: #424242 #1e1e1e; }
.cx-code pre[hidden] { display: none; }
.cx-code pre::selection, .cx-code pre *::selection { background: #264f78; }
.cx-code__line { display: block; min-height: 19px; padding-right: 20px; counter-increment: cx-line; }
.cx-code__line::before { content: counter(cx-line); position: sticky; left: 0; display: inline-block; width: 52px; padding-right: 18px; box-sizing: border-box; background: #1e1e1e; color: #6e7681; text-align: right; user-select: none; }
.cx-code__line:hover::before { color: #c6c6c6; }
.tk-comment { color: #6a9955; font-style: italic; }
.tk-string { color: #ce9178; }
.tk-number { color: #b5cea8; }
.tk-keyword { color: #569cd6; }
.tk-control { color: #c586c0; }
.tk-function, .tk-decorator { color: #dcdcaa; }
.tk-variable, .tk-property { color: #9cdcfe; }
.tk-constant { color: #4fc1ff; }
.tk-type { color: #4ec9b0; }
.tk-flag { color: #569cd6; }
.tk-bracket0 { color: #ffd700; }
.tk-bracket1 { color: #da70d6; }
.tk-bracket2 { color: #179fff; }

.cx-method { display: inline-flex; justify-content: center; min-width: 58px; padding: 2px 6px; border-radius: 6px; font-family: var(--mono); font-size: 11.5px; font-weight: 700; background: var(--hover); color: var(--muted); }
.cx-method--get { background: var(--info-soft); color: var(--info); }
.cx-method--post { background: var(--accent-soft); color: var(--accent); }
.cx-method--put, .cx-method--patch { background: var(--warn-soft); color: var(--warn); }
.cx-method--delete { background: var(--danger-soft); color: var(--danger); }
.cx-table td, .cx-table th { vertical-align: top; }
.cx-table td code { white-space: nowrap; }

@media (max-width: 900px) {
  .cx-two { grid-template-columns: minmax(0, 1fr); }
  .cx-docs { grid-template-columns: minmax(0, 1fr); }
  .cx-toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .cx-toc strong { display: none; }
  .cx-toc a { border: 1px solid var(--line); border-radius: 999px; }
  .cx-hero { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  .cx-code pre { font-size: 12px; line-height: 18px; }
  .cx-code__line { min-height: 18px; }
  .cx-code__line::before { width: 38px; padding-right: 12px; }
  .cx-code__bar [data-code-tab] { padding: 0 12px; }
}

/* Conector detenido (suscripción vencida, en exploración o pausada). */
.cx-stopped { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--warn-soft); color: var(--text); }
.cx-stopped > .icon { color: var(--warn); font-size: 24px; flex: 0 0 auto; }
.cx-stopped .grow { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; line-height: 1.5; }
.cx-stopped .btn { flex: 0 0 auto; align-self: center; }
@media (max-width: 640px) { .cx-stopped { flex-direction: column; } .cx-stopped .btn { align-self: stretch; } }
