/* Fiabilidad · salud del rastreo, capas de extracción y códigos de error */

.fia-main { padding-bottom: 96px; }

.fia-hero { padding-top: 80px; }
.fia-hero__title { max-width: 17em; }

/* ---- Tabla "Salud del rastreo" ---------------------------------------- */
.fia-health { padding-top: 64px; }

.health { border: 1px solid var(--ink); border-radius: 4px; overflow: hidden; background: var(--white); }
.health__head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 17px 22px; border-bottom: 1px solid var(--ink); background: var(--paper);
}
.health__title { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.health__name { font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: .04em; }
.health__live {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .07em; color: var(--orange-ink);
}
.health__dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--orange); display: block;
  box-shadow: 0 0 0 0 rgba(255, 102, 0, .5);
  transition: opacity .5s, box-shadow .5s;
}
.health__dot.is-dim { opacity: .35; box-shadow: 0 0 0 0 rgba(255, 102, 0, 0); }
.health__dot.is-pulse { opacity: 1; box-shadow: 0 0 0 5px rgba(255, 102, 0, .18); }
.health__legend { font-family: var(--mono); font-size: 12px; color: var(--muted); }

.health__scroll { overflow-x: auto; }
.health__table {
  width: 100%; min-width: 780px; border-collapse: collapse;
  font-family: var(--mono); font-size: 13px;
}
.health__table th {
  text-align: left; color: var(--muted); font-weight: 500;
  padding: 13px 12px; border-bottom: 1px solid var(--line);
}
.health__table td { padding: 14px 12px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.health__table th:first-child, .health__table td:first-child,
.health__table th:last-child, .health__table td:last-child { padding-left: 22px; padding-right: 22px; }
.health__table .num { text-align: right; }

.health__table tbody tr {
  transition: background .45s, opacity .6s var(--ease), transform .6s var(--ease);
}
.health__table tbody tr:hover { background: var(--paper-2); }
.health__dom { font-weight: 500; transition: box-shadow .45s; }
.health__att, .health__p95 { color: var(--ink-2); }
.health__p50 { color: var(--muted); }
.health__table td.health__err { color: var(--muted); white-space: normal; }

/* Fila que el barrido "en directo" está rastreando */
.health__table tbody tr.is-scan { background: var(--orange-wash); }
.health__table tbody tr.is-scan .health__dom { box-shadow: inset 3px 0 0 var(--orange); }

/* Estado inicial de la animación (lo pone fiabilidad.js; sin JS no aplica) */
.health.is-armed tbody tr { opacity: 0; transform: translateX(-14px); }
.health.is-armed tbody tr.is-in { opacity: 1; transform: none; }

/* Éxito: barrita + porcentaje */
.rate { display: inline-flex; align-items: center; gap: 8px; }
.rate__track { width: 46px; height: 5px; background: var(--chip); display: block; border-radius: 3px; overflow: hidden; }
.rate__bar { display: block; height: 5px; background: currentColor; transition: width 1.1s var(--ease); }
.rate__val { font-weight: 600; }
.rate--ok { color: var(--green); }
.rate--warn { color: #b4540a; }
.rate--bad { color: #b3261e; }
.w-99 { width: 99%; } .w-98 { width: 98%; } .w-96 { width: 96%; } .w-95 { width: 95%; }
.w-92 { width: 92%; } .w-91 { width: 91%; } .w-89 { width: 89%; }
.health.is-armed tbody tr:not(.is-in) .rate__bar { width: 0; }

.health__foot {
  display: flex; flex-wrap: wrap; gap: 24px; padding: 15px 22px;
  border-top: 1px solid var(--ink); background: var(--paper);
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.health__strong { color: var(--ink); }

.fia-note { margin-top: 14px; font-size: 14px; color: var(--muted); max-width: 48em; }

/* ---- Cómo extraemos · códigos ----------------------------------------- */
.fia-how { padding-top: 96px; }
.fia-how__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 44px; }
.fia-h2 { font-size: clamp(26px, 3vw, 38px); line-height: 1.08; letter-spacing: -.028em; font-weight: 700; }
.fia-text { margin-top: 18px; font-size: 16px; line-height: 1.62; color: var(--ink-2); }

.layers { margin-top: 28px; border-top: 1px solid var(--line); }
.layer {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 16px; align-items: baseline;
  padding: 15px 0; border-bottom: 1px solid var(--line);
}
.layer__n { font-family: var(--mono); font-size: 12px; color: var(--orange-ink); }
.layer__name { font-family: var(--mono); font-size: 14px; font-weight: 500; }
.layer__body { margin-top: 5px; font-size: 14px; line-height: 1.5; color: var(--muted); }

.codes { margin-top: 28px; display: flex; flex-direction: column; gap: 10px; }
.code-item {
  display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 16px; align-items: baseline;
  background: var(--paper); border-radius: 3px; padding: 14px 16px;
}
.code-item__code { font-family: var(--mono); font-size: 12px; font-weight: 600; color: #b3261e; white-space: nowrap; }
.code-item__body { font-size: 14px; line-height: 1.5; color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  .health__table tbody tr, .rate__bar, .health__dot, .health__dom { transition: none; }
}
