:root {
  --fondo: #f3f1ec;
  --papel: #fff;
  --tinta: #14304a;
  --tinta-2: #4a5d70;
  --linea: #d8d3c8;
  --azul: #1d5fd1;
  --azul-fuerte: #164aa6;
  --ok: #155f35;
  --ok-bg: #e4f4ea;
  --alerta: #8a301d;
  --alerta-bg: #fae8de;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  background: var(--fondo); color: var(--tinta); margin: 0;
  font: 1rem/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--azul-fuerte); }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--azul); outline-offset: 3px;
}
.barra { border-bottom: 1px solid var(--linea); background: var(--papel); }
.barra-contenido {
  max-width: 70rem; margin: auto; padding: 0.75rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: .65rem;
}
.marca { color: var(--tinta); text-decoration: none; font-size: 1.1rem; font-weight: 800; }
.marca b { color: var(--azul); }
.marca small { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
nav { display: flex; align-items: center; flex-wrap: wrap; gap: .85rem; }
.barra nav a, .texto { color: var(--tinta); text-decoration: none; font-size: .875rem; white-space: nowrap; }
.barra nav a:hover, .texto:hover { text-decoration: underline; }
.texto { font-family: inherit; background: none; padding: 0; border: 0; cursor: pointer; }
.envoltura { max-width: 70rem; min-height: 65vh; margin: auto; padding: 1.65rem 1rem 3rem; }
.pie { max-width: 70rem; margin: auto; padding: 0 1rem 1.5rem; color: var(--tinta-2); font-size: .875rem; }
h1, h2, h3, p { margin: 0 0 .5rem; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.75rem, 3.8vw, 2.5rem); line-height: 1.15; letter-spacing: -.025em; }
h2 { font-size: 1.18rem; line-height: 1.3; }
h3 { font-size: 1rem; }
.secundario { color: var(--tinta-2); font-size: .92rem; }
.categoria { text-transform: uppercase; font-weight: 700; font-size: .875rem; letter-spacing: .06em; }
.tarjeta { background: var(--papel); border: 1px solid var(--linea); border-radius: 3px; margin-bottom: .85rem; padding: 1rem; }
.encabezado { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; text-align: center;
  color: var(--tinta); background: var(--papel); border: 1px solid #a5b1ba; border-radius: 2px;
  padding: .55rem .85rem; line-height: 1.28; font-size: .875rem; font-family: inherit;
  font-weight: 700; letter-spacing: .035em; text-transform: uppercase; text-decoration: none; cursor: pointer;
}
.btn:hover { background: #edf2f9; }
.btn.azul { background: var(--azul); color: #fff; border-color: var(--azul); }
.btn.azul:hover { background: var(--azul-fuerte); }
.btn:disabled { opacity: .58; cursor: wait; }
.filtros, .campos { display: grid; gap: .85rem; grid-template-columns: minmax(0, 1fr); }
label { min-width: 0; display: block; font-size: .94rem; font-weight: 650; color: var(--tinta); }
label small { display: block; margin-top: .3rem; color: var(--tinta-2); font-size: .875rem; font-weight: 400; }
input, select, textarea {
  width: 100%; min-width: 0; max-width: 100%; display: block; margin: .3rem 0 0; min-height: 2.75rem;
  border: 1px solid #98a6b4; border-radius: 2px; padding: .55rem .65rem; background: var(--papel);
  font: inherit; font-size: 1rem; font-weight: 400; color: var(--tinta);
}
input[type="file"] { padding: .45rem; }
textarea { resize: vertical; }
input[readonly] { background: #f5f7fa; }
.pestanas { display: flex; flex-wrap: wrap; gap: .35rem 1rem; align-items: end; margin: 1.2rem 0 .8rem; }
.pestanas a { padding: .35rem 0; border-bottom: 2px solid transparent; text-decoration: none; color: var(--tinta-2); }
.pestanas .actual { color: var(--tinta); border-color: var(--azul); font-weight: 700; }
.pestanas .externo { color: var(--azul-fuerte); text-decoration: underline; margin-left: auto; font-size: .9rem; }
.resultado { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }
.ficha { min-width: 0; }
.resultado h2 { margin-bottom: .2rem; }
.resultado h2 a { text-decoration: none; }
.resultado h2 a:hover, .resultado h2 a:focus-visible { text-decoration: underline; }
.extracto { margin: .4rem 0 0; }
.indicadores { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem; }
.estado { padding: .22rem .45rem; background: #eef1f4; font-size: .875rem; color: var(--tinta-2); }
.estado.vigente { background: var(--ok-bg); color: var(--ok); }
.estado.alerta { background: var(--alerta-bg); color: var(--alerta); }
.vacio { padding: 1.4rem 1rem; }
.acceso { max-width: 31rem; margin: 3rem auto; padding: 1.4rem; }
.acceso p { margin-bottom: 1rem; }
.volver { display: inline-block; margin-bottom: .85rem; font-size: .95rem; }
.formulario > * + *, .formulario form > * + * { margin-top: .85rem; }
.formulario h2, .formulario h3 { margin-bottom: .6rem; }
.formulario form .btn, .formulario > .btn { margin-top: .85rem; }
.acciones { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.detalle { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; }
.detalle > * { min-width: 0; align-self: start; }
.vista { display: block; max-width: 100%; max-height: 48rem; object-fit: contain; }
.aviso { background: #edf2f9; border-left: 3px solid var(--azul); padding: .55rem .7rem; }
.subidas, .versiones { padding-left: 1.25rem; overflow-wrap: anywhere; }
.pagina { border-top: 1px solid var(--linea); padding: .6rem 0; }
.pagina p { white-space: pre-wrap; margin: .5rem 0 0; }
summary { cursor: pointer; font-weight: 700; }
.cliente { display: flex; align-items: center; justify-content: space-between; gap: .8rem; border-top: 1px solid var(--linea); padding-top: .75rem; }
.cliente > div { min-width: 0; overflow-wrap: anywhere; }
@media (min-width: 40rem) {
  .filtros { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; }
  .campos { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
  .campos .ancho { grid-column: 1 / -1; }
}
@media (min-width: 54rem) {
  .detalle { grid-template-columns: minmax(0, 1fr) minmax(16rem, .48fr); }
}
@media (max-width: 32rem) {
  .encabezado, .resultado { flex-direction: column; }
  .indicadores { justify-content: flex-start; }
  .pestanas .externo { margin-left: 0; }
  .barra nav { gap: .55rem; }
}
.filtros-fechas { grid-column: 1 / -1; }
.filtros-fechas .campos { margin-top: .7rem; }
