/* ════════════════════════════════════════════════════════════
   pairs.css — Capa 2: Vistas de pares
   Dueño exclusivo de: .pair-text*, .pair-detail*, .pairs-view*
   Solo usa variables de primitives.css. Cero hardcoded.
   ════════════════════════════════════════════════════════════ */

/* ── PairsView layout ───────────────────────────────────── */

.pairs-view {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  border-bottom: var(--query-border-top);
}

/* ── PairTextView ───────────────────────────────────────── */

.pairs-list-text { outline: none; }

.pair-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  height: 56px;
  padding: 4px 8px;
  box-sizing: border-box;
  border: 1px solid transparent;
  border-radius: var(--radius-base);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  flex-shrink: 0;
  justify-content: center;
}

.pair-text--selected {
  border-color: var(--conv-item-selected-border);
  background: var(--conv-item-selected-bg);
}

.pair-text__bubble {
  font-size: var(--font-size-sm);
  line-height: 1.3;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  box-sizing: border-box;
  max-width: 90%;
  color: var(--lyt-left-color);
  user-select: none;
  cursor: pointer;
}

.pair-text__bubble--query    { background: var(--pair-mini-query-bg);    align-self: flex-start; }
.pair-text__bubble--response { background: var(--pair-mini-response-bg); align-self: flex-end; }

/* ── PairDetailView ─────────────────────────────────────── */

.pair-detail {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  cursor: default;
}

.pair-detail * { cursor: default; }

.pair-detail__top {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--color-accent-soft);
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

.pair-detail__top-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 2px 6px;
  flex-shrink: 0;
}

.pair-detail__top-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.pair-detail__collapse-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 10px;
  color: var(--color-text-muted);
  padding: 2px 4px;
}

.pair-detail__top-content {
  flex: 1 1 0;
  overflow-y: auto;
  padding: 8px 12px;
  font-size: var(--font-size-base);
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--color-text-soft);
  cursor: text;
}

.pair-detail__bottom {
  flex: 1 1 0;
  overflow-y: auto;
  background: transparent;
  border-top: 2px solid var(--color-accent);
  padding: 12px 16px;
  box-sizing: border-box;
  user-select: text;
  outline: none;
  cursor: text;
  position: relative;
}

.pair-detail__copy-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  opacity: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text-muted);
  padding: 2px 5px;
  border-radius: var(--radius-sm);
  transition: opacity var(--transition-base), background var(--transition-base), color var(--transition-base);
  line-height: 1;
  z-index: 1;
}

.pair-detail__top:hover .pair-detail__copy-btn,
.pair-detail__bottom:hover .pair-detail__copy-btn {
  opacity: 1;
}

.pair-detail__copy-btn:hover {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.pair-detail__top-content:focus,
.pair-detail__bottom:focus { outline: none; }

.pair-detail__trivial {
  font-size: var(--font-size-base);
  color: var(--color-text-soft);
  line-height: var(--line-height-base);
  user-select: text;
}

.pair-detail__json {
  font-size: var(--font-size-sm);
  font-family: monospace;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: var(--line-height-base);
  padding: 8px;
  user-select: text;
}

/* ── Json2Html ──────────────────────────────────────────── */

.j2h {
  font-size: var(--j2h-size);
  line-height: var(--j2h-line-height);
  color: var(--j2h-color);
  background: transparent;
}

.j2h__titulo {
  font-size: var(--j2h-title-size);
  font-weight: var(--j2h-title-weight);
  margin: 0 0 10px 0;
  color: var(--j2h-title-color);
}

.j2h__descripcion {
  margin: 0 0 12px 0;
  color: var(--j2h-muted-color);
  font-weight: var(--font-weight-medium);
}

.j2h__seccion { margin-bottom: 14px; }

.j2h__seccion-titulo {
  font-size: var(--j2h-section-title-size);
  font-weight: var(--font-weight-bold);
  margin: 0 0 8px 0;
  color: var(--j2h-color);
}

.j2h__seccion-desc { margin: 0 0 8px 0; color: var(--j2h-muted-color); }
.j2h__parrafo      { margin: 0 0 8px 0; }
.j2h__lista        { margin: 0 0 10px 18px; padding: 0; }
.j2h__lista-item   { margin: 0 0 4px 0; }

.j2h__tabla-wrap {
  overflow-x: auto;
  margin: 8px 0 10px 0;
}

.j2h__tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.j2h__tabla-th,
.j2h__tabla-td {
  border: 1px solid var(--j2h-table-border);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.j2h__tabla-th {
  background: var(--j2h-table-header-bg);
  font-weight: var(--font-weight-bold);
  color: var(--j2h-title-color);
}

.j2h__formula {
  margin: 8px 0;
  padding: 8px 10px;
  background: var(--j2h-formula-bg);
  border: 1px solid var(--j2h-formula-border);
  border-radius: var(--radius-base);
  overflow-x: auto;
}

.j2h__formula-inline {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--j2h-formula-bg);
  padding: 1px 4px;
  border-radius: var(--radius-sm);
}

.j2h__nota-item {
  margin: 8px 0;
  padding: 8px 10px;
  background: var(--j2h-note-bg);
  border-left: 3px solid var(--j2h-note-border);
  border-radius: var(--radius-base);
}

.j2h__advertencia {
  margin: 8px 0;
  padding: 8px 10px;
  background: var(--j2h-warning-bg);
  border-left: 3px solid var(--j2h-warning-border);
  border-radius: var(--radius-base);
}

.j2h__codigo-wrap { margin: 8px 0; }

.j2h__codigo {
  margin: 0;
  padding: 10px 12px;
  background: var(--j2h-code-bg);
  color: var(--j2h-code-color);
  border-radius: var(--radius-base);
  overflow-x: auto;
  font-size: var(--font-size-sm);
}

.j2h__code-lang {
  margin-top: 4px;
  font-size: var(--font-size-sm);
  color: var(--j2h-muted-color);
  text-align: right;
}

.j2h__notas,
.j2h__referencias { margin-top: 12px; }

.j2h__referencias-titulo {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  margin: 0 0 6px 0;
}

.j2h__referencias-lista { margin: 0 0 0 18px; padding: 0; }
.j2h__referencia        { margin: 0 0 4px 0; }
