/* Única geometría autoritativa de la barra de PRÉSTAMOS.
   Mantiene la separación inferior de KOVRA Negocios y su área segura.
   El área segura NO se añade a la altura del panel (evita la banda vacía en iPhone).
   Exclusivo de Préstamos: Negocios conserva su diseño y comportamiento. */
@media (max-width:1024px) {
  /* No mostrar la distribución anterior mientras el HTML termina de cargar. */
  html:not(.kovra-loans-nav-ready) nav.bottom-nav:not(.kovra-business-nav) {
    visibility:hidden !important;
  }

  html body > nav.bottom-nav.kovra-loans-nav-root:not(.kovra-business-nav) {
    position:fixed !important;
    inset:auto 10px 0 10px !important;
    top:auto !important;
    left:10px !important;
    right:10px !important;
    /* The shared nav anchor is the sole owner of bottom positioning. */
    width:auto !important;
    max-width:none !important;
    height:82px !important;
    min-height:82px !important;
    max-height:82px !important;
    margin:0 !important;
    padding:6px 7px !important;
    display:grid !important;
    grid-template-columns:repeat(6,minmax(0,1fr)) !important;
    grid-template-rows:1fr !important;
    gap:2px !important;
    align-items:center !important;
    align-content:center !important;
    justify-items:stretch !important;
    box-sizing:border-box !important;
    border:1px solid var(--theme-border-strong,var(--theme-border)) !important;
    border-radius:24px !important;
    background:var(--theme-nav,var(--theme-surface)) !important;
    color:var(--theme-on-nav,var(--theme-text)) !important;
    box-shadow:0 -4px 16px rgba(0,0,0,.16) !important;
    overflow:visible !important;
    opacity:1 !important;
    visibility:visible !important;
    transform:none !important;
    translate:none !important;
    will-change:auto !important;
    z-index:2300 !important;
  }

  html body > nav.bottom-nav.kovra-loans-nav-root :is(.nav-button,.plans-nav-button) {
    position:relative !important;
    display:flex !important;
    flex-direction:column !important;
    align-items:center !important;
    justify-content:center !important;
    gap:4px !important;
    width:100% !important;
    min-width:0 !important;
    height:68px !important;
    min-height:68px !important;
    max-height:68px !important;
    margin:0 !important;
    padding:5px 1px !important;
    -webkit-tap-highlight-color:transparent !important;
    grid-row:1 !important;
    border:1px solid transparent !important;
    border-radius:17px !important;
    background:transparent !important;
    box-shadow:none !important;
    color:var(--theme-on-nav,var(--theme-text)) !important;
    opacity:1 !important;
    transform:none !important;
    text-decoration:none !important;
    box-sizing:border-box !important;
  }

  html body > nav.bottom-nav.kovra-loans-nav-root :is(.nav-button,.plans-nav-button).active {
    border-color:var(--theme-accent,var(--theme-border-strong)) !important;
    border-radius:17px !important;
    background:var(--theme-accent-soft,var(--theme-surface-2)) !important;
    color:var(--theme-accent-strong,var(--theme-accent)) !important;
  }

  html body > nav.bottom-nav.kovra-loans-nav-root :is(.nav-button,.plans-nav-button) > .nav-icon {
    display:grid !important;
    place-items:center !important;
    flex:0 0 27px !important;
    width:27px !important;
    height:27px !important;
    min-width:27px !important;
    min-height:27px !important;
    max-width:27px !important;
    max-height:27px !important;
    margin:0 auto !important;
    padding:0 !important;
    border:0 !important;
    background:transparent !important;
    box-shadow:none !important;
    color:inherit !important;
    font-size:0 !important;
    line-height:1 !important;
    transform:none !important;
  }

  html body > nav.bottom-nav.kovra-loans-nav-root .nav-icon svg {
    display:block !important;
    width:26px !important;
    height:26px !important;
    fill:none !important;
    stroke:currentColor !important;
    stroke-width:1.9 !important;
    stroke-linecap:round !important;
    stroke-linejoin:round !important;
    overflow:visible !important;
  }
  html body > nav.bottom-nav.kovra-loans-nav-root .nav-icon svg circle {
    fill:none !important;
  }
  html body > nav.bottom-nav.kovra-loans-nav-root .nav-icon svg.icon-dots circle {
    fill:currentColor !important;
    stroke:none !important;
  }

  html body > nav.bottom-nav.kovra-loans-nav-root :is(.nav-button,.plans-nav-button) > .nav-icon + span:not(.kovra-notification-unread-badge) {
    display:block !important;
    min-width:0 !important;
    width:100% !important;
    font-size:11px !important;
    font-weight:760 !important;
    line-height:1.05 !important;
    white-space:nowrap !important;
    text-align:center !important;
    letter-spacing:-.12px !important;
    color:inherit !important;
    overflow:visible !important;
  }

  html body > nav.bottom-nav.kovra-loans-nav-root #addButton {
    position:relative !important;
    inset:auto !important;
    grid-row:1 !important;
    width:56px !important;
    height:56px !important;
    min-width:56px !important;
    min-height:56px !important;
    max-width:56px !important;
    max-height:56px !important;
    margin:0 auto !important;
    padding:0 !important;
    justify-self:center !important;
    align-self:center !important;
    display:grid !important;
    place-items:center !important;
    border-radius:50% !important;
    background:var(--theme-accent) !important;
    color:var(--theme-on-accent) !important;
    font-size:34px !important;
    font-weight:700 !important;
    line-height:1 !important;
    transform:none !important;
  }
  html body > nav.bottom-nav.kovra-loans-nav-root #addButton.open {
    transform:rotate(45deg) !important;
  }
  html body > nav.bottom-nav.kovra-loans-nav-root :is(#homeButton,#homeCurrentButton) {grid-column:1 !important}
  html body > nav.bottom-nav.kovra-loans-nav-root :is(#clientsButton,#clientsCurrentButton) {grid-column:2 !important}
  html body > nav.bottom-nav.kovra-loans-nav-root #addButton {grid-column:3 !important}
  html body > nav.bottom-nav.kovra-loans-nav-root :is(#collectionsButton,#collectionsCurrentButton) {grid-column:4 !important}
  html body > nav.bottom-nav.kovra-loans-nav-root #plansNavButton {grid-column:5 !important}
  html body > nav.bottom-nav.kovra-loans-nav-root :is(#moreButton,#moreCurrentButton) {grid-column:6 !important}

  /* El espacio inferior es del contenido, nunca se suma a la barra. */
  html body:has(> nav.bottom-nav.kovra-loans-nav-root) {
    padding-bottom:calc(102px + env(safe-area-inset-bottom,0px)) !important;
  }
}

/* Formularios de préstamo y cobro: tamaño legible también en móvil. */
body.kri-new-loan :is(input,select,textarea){font-size:max(14px,1em)!important}
body.kri-new-loan :is(.field>span,.field small,.payment-count-note,.scheduled-payment-note,.late-fee-note){font-size:14px!important;line-height:1.4!important}
body.kri-payment :is(input,select,textarea){font-size:max(14px,1em)!important}
