/* Móvil: la ventana se ajusta a la pantalla visible (sin el teclado) y no se mueve; lista propia para los campos con datalist.
   Va al final y con :not(#z) para ganarle a las reglas con !important y con id del resto de las hojas. */
@media (max-width: 834px) {
  html.modal-abierto, html.modal-abierto body { overflow: hidden !important; overscroll-behavior: none; }
  html body .modal-overlay:not(#z):not(#z) {
    inset: var(--vvt, 0px) 0 auto 0 !important;
    height: var(--vvh, 100dvh) !important;
    max-height: var(--vvh, 100dvh) !important;
    overscroll-behavior: contain;
    touch-action: manipulation;
  }
  html body .modal-overlay:not(#z):not(#z) .modal-card:not(#z) {
    max-height: calc(var(--vvh, 100dvh) - 8px) !important;
    animation: none !important;
  }
  html body .modal-overlay:not(#z):not(#z) .modal-body:not(#z) {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scroll-padding-top: 72px;
    min-height: 0;
  }
  .dlx-box {
    grid-column: 1 / -1;
    box-sizing: border-box;
    width: 100%;
    margin: -2px 0 6px;
    max-height: min(264px, calc(var(--vvh, 100dvh) * .4));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--panel, #fff);
    border: 1px solid var(--line, #D6E6F2);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(10, 16, 28, .14);
  }
  .dlx-box[hidden] { display: none; }
  .dlx-item {
    display: flex; flex-direction: column; justify-content: center; gap: 1px;
    width: 100%; min-height: 48px; padding: 8px 14px; margin: 0;
    text-align: left; border: 0; border-bottom: 1px solid var(--line, #E5ECF3); border-radius: 0;
    background: transparent; color: var(--ink, #0F172A); font: inherit; font-size: 16px; cursor: pointer; box-shadow: none;
  }
  .dlx-item:last-child { border-bottom: 0; }
  .dlx-item strong { font-weight: 700; line-height: 1.2; color: var(--ink, #0F172A); }
  .dlx-item small { font-size: 13px; color: var(--muted, #64748B); line-height: 1.2; }
  .dlx-item:active { background: var(--blue-soft, #E8F3FB); }
}
