/* Lote 5, simetría. Va al final de todo para ordenar lo que cada pantalla hizo por su lado:
   1) todo lo que se toca mide al menos 48 px de alto;
   2) todas las casillas y botones de opción miden lo mismo (28 px) y su renglón entero es tocable;
   3) los botones de periodo son iguales en todas las pantallas (6 iguales: 3 por fila en celular, 6 en una fila en pantalla ancha);
   4) en toda ventana el botón principal queda siempre a la derecha y los demás a su izquierda. */
:root{--tocable:48px;--casilla:28px}

/* 1) Alturas táctiles */
html body .btn,html body .campo,html body select,html body summary,html body button.cerrar,html body .per-btn,html body .doc-rango .btn{min-height:var(--tocable)}
html body input.campo,html body select.campo{min-height:var(--tocable)}
@media(max-width:700px){html body .linea>.cant-inp,html body .linea>.precio-inp,html body .linea .linea-nombre,html body .linea .linea-x,html body .inv-simple .inv-rubro-fila .campo{min-height:var(--tocable)}}
html body .inv-simple .inv-rubro-fila .campo{min-height:var(--tocable)}

/* 2) Casillas y botones de opción */
html body input[type=checkbox],html body input[type=radio],html body .av-check input,html body .cobro-chk input,html body .mt-radios input,html body .mt-interruptor input{width:var(--casilla);height:var(--casilla);flex:0 0 auto;accent-color:var(--rojo)}
html body label:has(>input[type=checkbox]),html body label:has(>input[type=radio]),html body .inv-casilla,html body .av-check{min-height:var(--tocable);display:flex;align-items:center;gap:.6rem;cursor:pointer}

/* 3) Selector de periodo igual en todas partes */
html body .per-botones,html body .doc-rango{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.5rem}
html body .per-btn,html body .doc-rango .btn{min-width:0;padding-inline:.4rem;font-size:1rem;line-height:1.15}
@media(min-width:760px){html body .per-botones,html body .doc-rango{grid-template-columns:repeat(6,minmax(0,1fr))}}
html body .per-btn[aria-pressed=true],html body .doc-rango .btn[aria-pressed=true]{background:var(--rojo);border-color:var(--rojo);color:#fff}

/* 4) Posición fija de los botones al pie de una ventana: lo principal siempre a la derecha */
html body .modal-pie .btn{order:0}
html body .modal-pie .btn.primario,html body .modal-pie .btn.peligro{order:2}
html body .modal-pie .btn.suave{order:0}

/* 5) Filtros de Anular y reimprimir: botones del mismo ancho en columnas parejas (2 en celular, los que quepan en pantalla ancha); si queda uno solo en la última fila ocupa todo el ancho */
html body .doc-filtros{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.5rem}
html body .doc-filtros .btn{min-width:0;width:100%;padding-inline:.5rem;line-height:1.15;text-align:center}
html body .doc-filtros .btn:last-of-type:nth-of-type(odd){grid-column:1/-1}
html body .doc-filtros .doc-tarifa,html body .doc-filtros .doc-aviso-filtro{grid-column:1/-1}
@media(min-width:760px){html body .doc-filtros{grid-template-columns:repeat(auto-fit,minmax(11rem,1fr))}html body .doc-filtros .btn:last-of-type:nth-of-type(odd){grid-column:auto}}

/* 6) Grupos de botones parejos en el resto de pantallas: mismo ancho, columnas fijas, sin una fila a medias ni un botón gigante solo */
html body .mt-herr,html body .lis-orden,html body .con-tabs,html body .rec-vistas,html body .inv-seg-grupo,html body .av-persona-btns{display:grid;gap:.5rem;align-items:stretch}
html body .mt-herr>.btn,html body .lis-orden>.btn,html body .con-tabs>*,html body .rec-vistas>*,html body .inv-seg-grupo>*,html body .av-persona-btns>*{min-width:0;width:100%;text-align:center;line-height:1.15;padding-inline:.5rem}
html body .mt-herr{grid-template-columns:repeat(2,minmax(0,1fr))}
html body .mt-herr>.rotulo,html body .lis-orden>.tenue{grid-column:1/-1;margin:0}
html body .lis-orden{grid-template-columns:repeat(3,minmax(0,1fr))}
html body .inv-seg-grupo{grid-template-columns:repeat(3,minmax(0,1fr))}
html body .con-tabs,html body .rec-vistas{grid-template-columns:repeat(2,minmax(0,1fr))}
html body .av-persona-btns{grid-template-columns:minmax(0,1fr)}
html body .fx-seg{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr)}
html body .fx-seg button{flex:none;min-width:0}
@media(min-width:760px){
  html body .mt-herr{grid-template-columns:repeat(4,minmax(0,1fr))}
  html body .con-tabs{grid-template-columns:repeat(auto-fit,minmax(7.5rem,1fr))}
  html body .rec-vistas{grid-template-columns:repeat(4,minmax(0,1fr))}
  html body .av-persona-btns{grid-template-columns:repeat(3,minmax(0,1fr))}
}

/* 7) Pares de botones: mismo ancho, lado a lado */
html body .mt-btns,html body .mt-acciones,html body .acc,html body .inv-hoy-extras,html body .fila:has(>.btn:first-child:nth-last-child(2)):has(>.btn:last-child){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.5rem;align-items:stretch}
html body .mt-btns>.btn,html body .mt-acciones>.btn,html body .acc>.btn,html body .inv-hoy-extras>.btn,html body .fila:has(>.btn:first-child:nth-last-child(2)):has(>.btn:last-child)>.btn{min-width:0;width:100%;text-align:center;line-height:1.15;padding-inline:.5rem}
html body .mt-resumen{display:grid;grid-template-columns:minmax(0,1fr);gap:.5rem}
html body .mt-resumen>*{width:100%;text-align:center}
@media(max-width:559px){html body .inv-hoy-extras{grid-template-columns:minmax(0,1fr)}}

/* 8) Informes «Vista» (2 botones bajo su rótulo) e Inventarios (8 tarjetas: 4 + 4 en pantalla ancha, 2 en las demás) */
html body .lis-vista{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.5rem}
html body .lis-vista>.tenue{grid-column:1/-1}
html body .lis-vista>.btn{min-width:0;width:100%;text-align:center;line-height:1.15;padding-inline:.5rem}
html body .inv-menu{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(min-width:900px){html body .inv-menu{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:520px){html body .inv-menu{grid-template-columns:minmax(0,1fr)}}

/* 9) Descargar + Imprimir en Informes: mismos anchos (uno bajo otro en celular, lado a lado desde 560 px) */
html body .par-botones{display:grid;grid-template-columns:minmax(0,1fr);gap:.5rem}
html body .par-botones>*{min-width:0;width:100%}
html body .par-botones .btn{width:100%;text-align:center;justify-content:center}
@media(min-width:560px){html body .par-botones{grid-template-columns:repeat(2,minmax(0,1fr))}}
html body .par-botones{width:100%;max-width:none}

/* 10. Recibir (pruebas del 3 nov): en teléfono la fila de factura apila documento, empresa, estado y total sin solaparse; todo botón mide 48 px, también «Deshacer» dentro de los avisos */
@media (max-width:759px){
  html body .rc-fac-fila{flex-wrap:wrap;gap:.2rem .8rem}
  html body .rc-fac-abrir{flex:1 1 100%;min-width:0}
  html body .rc-fac-doc{white-space:normal}
  html body .rc-fac-emp{flex:1 1 auto}
  html body .rc-fac-estado{flex:1 1 100%;justify-content:flex-start;flex-wrap:wrap}
  html body .rc-fac-total{flex:0 0 auto;margin-left:auto}
  html body .rc-fac-acc{flex:1 1 100%;margin-left:0}
}
html body .inv-eco .btn,html body .inv-eco .btn.chico{min-height:48px}

/* 11. Recibir: selector de empresa con tres botones del mismo ancho; tarjetas de siglas del mismo ancho; Deshacer de 48 px (gana a .rc-sigla .inv-eco .btn de recibir.css) */
html body .inv-segmento.rc-seg{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.5rem;width:100%;max-width:34rem}
html body .inv-segmento.rc-seg .btn.inv-seg{width:100%;min-width:0;white-space:normal;line-height:1.15}
@media (max-width:520px){html body .inv-segmento.rc-seg{grid-template-columns:repeat(2,minmax(0,1fr))}html body .inv-segmento.rc-seg .btn.inv-seg:last-child:nth-child(odd){grid-column:1 / -1}}
html body .rc-siglas{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,22rem),1fr));gap:.5rem;align-items:stretch}
html body .rc-sigla{flex:none;max-width:none;width:100%}
html body .rc-sigla .inv-eco .btn,html body .rc-sigla .inv-eco .btn.chico{min-height:48px}
