:root {
  --tinta: #202124;
  --suave: #68696d;
  --borde: #dedede;
  --fondo: #f4f4f2;
  --blanco: #fff;
  --negro: #262626;
  --exito: #176b45;
  --alerta: #8a5a14;
  --error: #9b3232;
  --sombra: 0 16px 45px rgba(0, 0, 0, 0.055);
  --radio: 18px;
  --transicion: 190ms ease;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  color-scheme: light;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  color: var(--tinta);
  background: var(--fondo);
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
}
button,
input {
  font: inherit;
}
.contenedor {
  width: min(1160px, calc(100% - 2rem));
  margin-inline: auto;
}
.encabezado {
  color: #fff;
  background: #222;
  border-bottom: 1px solid #404040;
}
.encabezado__interior,
.identidad,
.encabezado__acciones,
.visor__encabezado,
.visor__acciones,
.fecha-control,
.fechas-encabezado {
  display: flex;
  align-items: center;
}
.encabezado__interior {
  min-height: 78px;
  justify-content: space-between;
  gap: 1rem;
}
.identidad {
  gap: 0.8rem;
}
.identidad p {
  margin: 0;
}
.identidad__marca {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  object-fit: contain;
}
.identidad__institucion {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 700;
}
.identidad__estado,
.encabezado__leyenda {
  color: #c8c8c8;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.encabezado__acciones {
  justify-content: flex-end;
  gap: 1rem;
}
.encabezado__leyenda {
  margin: 0;
}
.encabezado__regresar {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0.48rem 0.9rem;
  color: #292929;
  background: #f7f7f5;
  border: 1px solid #d2d2cf;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  transition:
    background var(--transicion),
    border-color var(--transicion);
}
.encabezado__regresar:hover,
.encabezado__regresar:focus-visible {
  background: #e5e5e2;
  border-color: #fff;
}
.contenido {
  padding-block: clamp(2.5rem, 6vw, 5rem);
}
.presentacion {
  max-width: 780px;
  margin-bottom: 2.2rem;
}
.sobrelinea {
  margin: 0 0 0.4rem;
  color: #656565;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
h1,
h2,
h3 {
  margin: 0;
  line-height: 1.18;
}
h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
}
h1 {
  font-size: clamp(2.5rem, 6vw, 4.7rem);
  font-weight: 500;
  letter-spacing: -0.025em;
}
h2 {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 600;
}
h3 {
  font-size: 1rem;
}
.presentacion__texto {
  margin: 0.8rem 0 0;
  color: var(--suave);
  font-size: 1.08rem;
}
.flujo {
  display: grid;
  gap: 1rem;
}
.panel {
  padding: clamp(1.25rem, 3.5vw, 2.25rem);
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
}
.panel[hidden],
.visor[hidden],
.resultados[hidden],
.fecha-personalizada[hidden] {
  display: none;
}
.panel__titulo {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
}
.panel__titulo p,
.resultados__cabecera p,
.visor__encabezado p {
  margin: 0.25rem 0 0;
  color: var(--suave);
}
.paso {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: #555;
  background: #f0f0ee;
  border: 1px solid #e1e1df;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 800;
}
fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.sedes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}
.sede {
  min-height: 82px;
  padding: 1rem;
  color: var(--tinta);
  background: #fafafa;
  border: 1px solid var(--borde);
  border-radius: 13px;
  font-size: 1rem;
  font-weight: 750;
  cursor: pointer;
  transition:
    transform var(--transicion),
    border-color var(--transicion),
    background var(--transicion),
    box-shadow var(--transicion);
}
.sede:hover {
  transform: translateY(-2px);
  border-color: #999;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.07);
}
.sede[aria-pressed="true"] {
  color: #fff;
  background: var(--negro);
  border-color: var(--negro);
  box-shadow:
    inset 0 0 0 2px #fff,
    inset 0 0 0 3px #555;
}
.chips,
.atajos-fecha,
.acciones-seleccion {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.chip-grupo,
.chip-accion,
.filtros button {
  min-height: 42px;
  padding: 0.55rem 0.9rem;
  color: #3b3b3b;
  background: #f6f6f4;
  border: 1px solid #d6d6d3;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background var(--transicion),
    color var(--transicion),
    border-color var(--transicion);
}
.chip-grupo:hover,
.chip-accion:hover,
.filtros button:hover {
  border-color: #777;
}
.chip-grupo[aria-pressed="true"],
.filtros button[aria-pressed="true"] {
  color: #fff;
  background: #303030;
  border-color: #303030;
}
.acciones-seleccion {
  justify-content: flex-end;
  margin: -0.5rem 0 1rem;
}
.enlace-boton {
  padding: 0.35rem;
  color: #414141;
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.enlace-boton:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.juzgados {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}
.juzgado {
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  background: #fafafa;
  border: 1px solid var(--borde);
  border-radius: 11px;
  cursor: pointer;
  transition:
    border-color var(--transicion),
    background var(--transicion);
}
.juzgado:hover {
  border-color: #999;
}
.juzgado:has(input:checked) {
  background: #eeeeeb;
  border-color: #555;
}
.juzgado input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: #292929;
}
.juzgado span {
  font-weight: 650;
}
.fecha-personalizada {
  max-width: 560px;
  margin-top: 1.2rem;
  padding: 1rem;
  background: #f7f7f5;
  border: 1px solid var(--borde);
  border-radius: 12px;
}
.fecha-personalizada label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.88rem;
  font-weight: 750;
}
.fecha-control {
  gap: 0.6rem;
}
.fecha-control input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 0.6rem 0.75rem;
  border: 1px solid #aaa;
  border-radius: 9px;
}
.mensaje {
  min-height: 1.5em;
  margin: 0.45rem 0 0;
  color: var(--error);
  font-size: 0.88rem;
}
.fechas-encabezado {
  justify-content: space-between;
  margin-top: 0.6rem;
}
.fechas-encabezado p {
  margin: 0;
  color: var(--suave);
  font-size: 0.9rem;
}
.fechas {
  margin-top: 0.65rem;
}
.chip-fecha {
  padding: 0.5rem 0.75rem;
  color: #fff;
  background: #3a3a3a;
  border: 0;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}
.resumen-previo {
  margin-top: 0.4rem;
  background: #ebebe8;
}
.metricas {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 1.4rem 0;
  background: #cacac6;
  border: 1px solid #cacac6;
  border-radius: 12px;
  overflow: hidden;
}
.metricas p {
  display: flex;
  min-height: 100px;
  flex-direction: column;
  justify-content: center;
  margin: 0;
  padding: 1rem;
  background: #f8f8f6;
  text-align: center;
}
.metricas strong {
  font-family: Georgia, serif;
  font-size: 2rem;
  line-height: 1;
}
.metricas span {
  margin-top: 0.45rem;
  color: var(--suave);
  font-size: 0.82rem;
}
.acciones-formulario {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.ayuda {
  margin: 0;
  color: var(--suave);
  font-size: 0.85rem;
}
.boton {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.65rem 1rem;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition:
    background var(--transicion),
    border-color var(--transicion),
    transform var(--transicion);
}
.boton:hover {
  transform: translateY(-1px);
}
.boton:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.boton--principal {
  color: #fff;
  background: #292929;
}
.boton--principal:hover {
  background: #111;
}
.boton--secundario {
  color: #303030;
  background: #fff;
  border-color: #aaa;
}
.boton--secundario:hover {
  background: #f0f0ed;
  border-color: #666;
}
button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid #777;
  outline-offset: 3px;
}
.resultados {
  margin-top: 1.5rem;
}
.resultados__cabecera {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.filtros button {
  min-height: 38px;
  font-size: 0.82rem;
}
.matriz table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--borde);
  border-radius: 12px;
  overflow: hidden;
}
.matriz th,
.matriz td {
  padding: 0.85rem;
  border-right: 1px solid var(--borde);
  border-bottom: 1px solid var(--borde);
  text-align: center;
}
.matriz th:first-child {
  text-align: left;
}
.matriz thead th {
  color: #666;
  background: #f3f3f1;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}
.matriz tr:last-child > * {
  border-bottom: 0;
}
.matriz tr > *:last-child {
  border-right: 0;
}
.matriz td {
  font-size: 0.82rem;
  font-weight: 750;
}
.matriz td[data-estado="available"] {
  background: #edf6f1;
  color: var(--exito);
}
.matriz td[data-estado="unavailable"] {
  color: var(--alerta);
}
.matriz td[data-estado="error"] {
  color: var(--error);
}
.abrir-lista {
  padding: 0.4rem 0.55rem;
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 6px;
  font-weight: 750;
  cursor: pointer;
}
.tarjetas-resultados {
  display: none;
}
.visor {
  margin-top: 1.5rem;
}
.visor__encabezado {
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.4rem;
}
.visor__acciones {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem;
}
.visor__marco {
  display: block;
  width: 100%;
  height: min(72vh, 820px);
  min-height: 480px;
  background: #e5e5e5;
  border: 1px solid var(--borde);
  border-radius: 10px;
}
.visor__alternativa {
  margin: 0.8rem 0 0;
  color: var(--suave);
  font-size: 0.82rem;
  text-align: center;
}
.pie {
  margin-top: 3rem;
  color: #ccc;
  background: #222;
}
.pie .contenedor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  min-height: 88px;
  gap: 1rem;
}
.pie p {
  margin: 0;
  font-size: 0.85rem;
}
.pie p:last-child {
  text-align: right;
}
.pie__logo {
  width: clamp(80px, 8vw, 96px);
  height: 52px;
  object-fit: contain;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 720px) {
  .identidad__marca {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }
  .encabezado__leyenda {
    display: none;
  }
  .sedes,
  .juzgados,
  .metricas {
    grid-template-columns: 1fr;
  }
  .sede {
    min-height: 60px;
  }
  .acciones-seleccion {
    justify-content: flex-start;
  }
  .metricas {
    gap: 0;
  }
  .metricas p {
    min-height: 76px;
    border-bottom: 1px solid #ddd;
  }
  .acciones-formulario,
  .resultados__cabecera,
  .visor__encabezado {
    align-items: stretch;
    flex-direction: column;
  }
  .acciones-formulario .boton {
    width: 100%;
  }
  .matriz {
    display: none;
  }
  .tarjetas-resultados {
    display: grid;
    gap: 0.7rem;
  }
  .resultado-tarjeta {
    padding: 1rem;
    background: #fafafa;
    border: 1px solid var(--borde);
    border-left: 4px solid #777;
    border-radius: 10px;
  }
  .resultado-tarjeta p {
    margin: 0.25rem 0;
    color: var(--suave);
    text-transform: capitalize;
  }
  .resultado-tarjeta strong {
    display: block;
    margin: 0.4rem 0;
  }
  .resultado-tarjeta[data-estado="available"] {
    border-left-color: var(--exito);
  }
  .resultado-tarjeta[data-estado="unavailable"] {
    border-left-color: var(--alerta);
  }
  .resultado-tarjeta[data-estado="error"] {
    border-left-color: var(--error);
  }
  .resultado-tarjeta .abrir-lista {
    width: 100%;
    margin-top: 0.5rem;
    min-height: 44px;
  }
  .visor__acciones {
    display: grid;
    grid-template-columns: 1fr;
  }
  .visor__marco {
    min-height: 60vh;
  }
  .pie .contenedor {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 0.8rem;
    padding-block: 1.5rem;
    text-align: center;
  }
  .pie p:last-child {
    text-align: center;
  }
  .fecha-control {
    align-items: stretch;
    flex-direction: column;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
#abrir-pdf {
  display: none;
}