/* Ajustes visuales de la cuenta.
   Igual que en la implementacion de referencia del repo, el CSS se mantiene
   minimo: el tema, el logo y el avatar hacen el trabajo. Aqui solo se acota el
   ancho de lectura y se suavizan las tablas, que es lo que mas se usa en las
   respuestas de este analista. */

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.markdown-body table th,
.markdown-body table td {
  padding: 0.35rem 0.6rem;
  border: 1px solid rgba(128, 128, 128, 0.25);
}

.markdown-body table th {
  text-align: left;
  font-weight: 600;
}

/* Numeros alineados a la derecha cuando la celda es solo cifra. */
.markdown-body table td:not(:first-child) {
  text-align: right;
}

/* ── Tablas legibles (piloto Revlon, 2026-10-29) ─────────────────────────────
   Solo afecta al elemento TablaCopiable cuando la cuenta declara
   `responsive_tables: true` (clases tc-*; las demas cuentas no las reciben).
   Tipografia: tabla 15 px, cabeceras 14 px, notas 13-14 px, botones 14 px.
   Las cifras nunca se parten en dos lineas (signo y valor juntos). */

.tc-r {
  padding-top: 44px !important;
  font-variant-numeric: tabular-nums;
}

.tc-r .tc-boton {
  font-size: 14px !important;
  line-height: 20px !important;
  padding: 6px 10px !important;
  min-height: 34px;
}

.tc-r .tc-aviso {
  position: static !important;
  display: block;
  margin: 0 0 8px;
  font-size: 13px !important;
}

.tc-r table {
  font-size: 15px;
}

.tc-r th {
  height: auto;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.3;
  vertical-align: bottom;
}

.tc-r td {
  padding: 9px 10px;
  line-height: 1.4;
}

.tc-r td.tc-num,
.tc-r td.tc-corto {
  white-space: nowrap;
}

.tc-r tr.tc-total {
  background: hsl(var(--muted));
  border-top: 2px solid hsl(var(--border));
}

/* Vista compacta (tarjetas): misma informacion que la tabla, una fila por tarjeta. */
.tc-compacta .tc-leyenda {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.4;
  color: hsl(var(--muted-foreground));
}

.tc-compacta .tc-lista {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid hsl(var(--border));
  border-radius: 12px;
  overflow: hidden;
  background: hsl(var(--card));
}

.tc-compacta .tc-fila {
  padding: 10px 12px;
}

.tc-compacta .tc-fila + .tc-fila {
  border-top: 1px solid hsl(var(--border));
}

.tc-compacta .tc-cabeza {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.tc-compacta .tc-pos {
  flex: none;
  min-width: 26px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: hsl(var(--muted));
  font-size: 13px;
  font-weight: 600;
  line-height: 22px;
  text-align: center;
}

.tc-compacta .tc-entidad {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.tc-compacta .tc-principal {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.tc-compacta .tc-var {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.tc-compacta .tc-datos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px 12px;
  margin: 8px 0 0;
}

.tc-compacta .tc-dato dt {
  font-size: 13px;
  line-height: 1.3;
  color: hsl(var(--muted-foreground));
}

.tc-compacta .tc-dato dd {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  white-space: nowrap;
}

.tc-compacta .tc-sub {
  display: block;
  font-size: 14px;
  font-weight: 400;
  color: hsl(var(--muted-foreground));
}

.tc-compacta .tc-total {
  background: hsl(var(--muted));
  border-top: 2px solid hsl(var(--border)) !important;
}

/* Sello y notas metodologicas del elemento: 14 px, sin cambiar los titulos. */
.tc-raiz .tc-nota [role="article"] {
  font-size: 14px;
  line-height: 1.55;
  color: hsl(var(--muted-foreground));
}

/* Panel estrecho (visor incrustado: el ancho del iframe es el del panel). */
@media (max-width: 520px) {
  .ai-message {
    gap: 10px;
  }

  div.p-4:has(> .step) {
    padding-left: 12px;
    padding-right: 12px;
  }
}
