/* Ajuste profesional de tipografías por tipo de página
   Mantiene el diseño elegante, pero reduce tamaños excesivos y mejora la lectura. */
:root{
  --cf-font-base: 15.2px;
  --cf-font-small: .87rem;
  --cf-font-normal: .98rem;
  --cf-font-title: 1.55rem;
  --cf-font-subtitle: 1.12rem;
}
html{font-size:var(--cf-font-base)!important;}
body{font-size:var(--cf-font-normal)!important;line-height:1.5!important;text-rendering:optimizeLegibility;}
p,.text-muted,.footer-note,.info-line,.hint,.map-note,.card-text{font-size:.96rem!important;line-height:1.5!important;}
.navbar-brand span{font-size:1rem!important;}
.badge{font-size:.75rem!important;font-weight:800!important;}
.btn{font-size:.92rem!important;padding:.58rem .9rem!important;border-radius:12px!important;line-height:1.28!important;}
.btn-sm{font-size:.76rem!important;padding:.34rem .55rem!important;border-radius:10px!important;}
.form-label{font-size:.88rem!important;margin-bottom:.36rem!important;}
.form-control,.form-select{font-size:.96rem!important;padding:.6rem .76rem!important;min-height:auto!important;}
textarea.form-control{line-height:1.35!important;}
.table{font-size:.86rem!important;}
.table th{font-size:.78rem!important;text-transform:uppercase;letter-spacing:.025rem;}
.card-body{font-size:.97rem!important;}
.card-body.p-4{padding:1.25rem!important;}
.card-body.p-lg-5{padding:1.55rem!important;}

/* Portada pública */
.page-public-home .hero{padding:42px 30px!important;border-radius:28px!important;}
.page-public-home .hero h1{font-size:clamp(1.75rem,3.1vw,2.65rem)!important;line-height:1.1!important;letter-spacing:-.03em!important;}
.page-public-home .hero p{font-size:1rem!important;max-width:720px!important;}
.page-public-home .access-icon{width:62px!important;height:62px!important;border-radius:20px!important;font-size:1.75rem!important;margin-bottom:14px!important;}
.page-public-home h4{font-size:1.05rem!important;font-weight:800!important;}

/* Login */
.page-login .login-card{border-radius:26px!important;}
.page-login .login-head{padding:26px!important;}
.page-login .logo{width:64px!important;height:64px!important;border-radius:22px!important;font-size:1.9rem!important;}
.page-login h2{font-size:1.45rem!important;}

/* Panel administrador */
.page-admin-dashboard .sidebar{font-size:.9rem!important;}
.page-admin-dashboard .brand-icon{width:44px!important;height:44px!important;border-radius:15px!important;font-size:1.25rem!important;}
.page-admin-dashboard .brand h3{font-size:.95rem!important;}
.page-admin-dashboard .nav-label{font-size:.58rem!important;letter-spacing:.1rem!important;}
.page-admin-dashboard .nav-link{font-size:.88rem!important;padding:10px 12px!important;}
.page-admin-dashboard .hero{padding:22px!important;border-radius:24px!important;}
.page-admin-dashboard .hero h1{font-size:clamp(1.45rem,2vw,1.95rem)!important;line-height:1.15!important;}
.page-admin-dashboard .metric-icon{width:48px!important;height:48px!important;border-radius:16px!important;font-size:1.35rem!important;margin-bottom:10px!important;}
.page-admin-dashboard .metric-card h2{font-size:1.78rem!important;}
.page-admin-dashboard .quick-card i{font-size:1.55rem!important;}
.page-admin-dashboard .quick-card h5{font-size:1rem!important;}

/* Listados públicos y administrativos */
.page-public-list .hero,.page-admin-tool .hero{padding:22px 0!important;border-radius:0 0 24px 24px!important;}
.page-public-list .hero h1,.page-admin-tool .hero h1{font-size:clamp(1.45rem,2.6vw,2rem)!important;line-height:1.12!important;}
.page-public-list .filter-card{border-radius:20px!important;}
.page-public-list .business-card h5,.page-public-list .card h5{font-size:1rem!important;}
.page-public-list .category-pill{font-size:.72rem!important;padding:5px 9px!important;}
.page-public-list .business-img,.page-public-list .no-img{height:170px!important;}

/* Formularios de administrador */
.page-admin-form .hero{padding:22px 0!important;border-radius:0 0 24px 24px!important;}
.page-admin-form h1,.page-admin-form .h3{font-size:1.48rem!important;line-height:1.22!important;}
.page-admin-form .section-title{font-size:.95rem!important;margin-bottom:12px!important;}
.page-admin-form .card-form,.page-admin-form .card{border-radius:22px!important;}
.page-admin-form .geo-status{font-size:.78rem!important;padding:6px 9px!important;}
.page-admin-form #map,.page-admin-form .mapa,.page-admin-form .leaflet-container{font-size:.82rem!important;}

/* Fichas públicas */
.page-public-ficha .ficha{border-radius:24px!important;}
.page-public-ficha .ficha-header h1{font-size:clamp(1.55rem,2.8vw,2.1rem)!important;line-height:1.1!important;}
.page-public-ficha .ficha-header p{font-size:.95rem!important;}
.page-public-ficha .info-box small{font-size:.72rem!important;letter-spacing:.035rem!important;}
.page-public-ficha .info-box strong{font-size:1rem!important;line-height:1.28!important;}
.page-public-ficha .map-title{font-size:1.05rem!important;}
.page-public-ficha .map-note{font-size:.82rem!important;}

/* Pantallas medianas */
@media(max-width:992px){
  html{font-size:14px!important;}
  .page-public-home .hero{padding:34px 22px!important;}
  .page-public-home .hero h1{font-size:clamp(1.6rem,7vw,2.3rem)!important;}
  .card-body.p-4,.card-body.p-lg-5{padding:1.1rem!important;}
}

/* Celulares */
@media(max-width:576px){
  html{font-size:13.6px!important;}
  body{font-size:.92rem!important;}
  .container{padding-left:14px!important;padding-right:14px!important;}
  .page-public-home .hero{padding:28px 18px!important;border-radius:22px!important;}
  .page-public-home .hero h1{font-size:1.65rem!important;}
  .page-public-home .hero p{font-size:.9rem!important;}
  .btn{font-size:.84rem!important;}
  .table{font-size:.78rem!important;}
}

/* Impresión: letra compacta y ficha completa en una hoja */
@media print{
  @page{size:A4 portrait;margin:7mm;}
  html,body{font-size:10.5px!important;line-height:1.22!important;background:#fff!important;color:#111!important;}
  h1{font-size:17px!important;line-height:1.05!important;margin-bottom:4px!important;}
  h2,h3{font-size:14px!important;line-height:1.1!important;}
  p,.text-muted,.map-note{font-size:9.5px!important;line-height:1.18!important;}
  .btn,.no-print,.cf-music-button,audio,nav,.navbar{display:none!important;}
  .container{width:100%!important;max-width:100%!important;padding:0!important;margin:0!important;}
  .card,.ficha,.panel-card,.business-card{box-shadow:none!important;border:1px solid #cfd8e3!important;border-radius:10px!important;page-break-inside:avoid!important;}
  .card-body{padding:7px!important;}
  .ficha-header{padding:8px!important;border-radius:10px!important;}
  .ficha-header h1{font-size:18px!important;line-height:1.05!important;}
  .ficha-header p{font-size:9.5px!important;line-height:1.15!important;}
  .info-box{padding:5px 6px!important;border-radius:7px!important;margin-bottom:4px!important;}
  .info-box small{font-size:7.5px!important;line-height:1!important;}
  .info-box strong{font-size:9.5px!important;line-height:1.12!important;}
  .badge,.badge-cat{font-size:8px!important;padding:3px 6px!important;}
  .map-title{font-size:11px!important;margin:5px 0!important;}
  .map-note{padding:4px 6px!important;margin-bottom:4px!important;border-radius:6px!important;}
}


/* Ajuste final: tipografía equilibrada y ficha de negocio en una sola hoja */
@media screen{
  body{font-size:.98rem!important;}
  .page-public-ficha .info-box strong,
  .page-public-list .business-card h5,
  .page-public-list .card h5{font-size:1rem!important;}
  .page-admin-form .section-title{font-size:1rem!important;}
  .table{font-size:.9rem!important;}
}

@media(max-width:992px){
  html{font-size:14.6px!important;}
}

@media(max-width:576px){
  html{font-size:14px!important;}
  body{font-size:.95rem!important;}
  .btn{font-size:.88rem!important;}
}

@media print{
  html,body{font-size:11.3px!important;line-height:1.25!important;}
  p,.text-muted,.map-note{font-size:10px!important;line-height:1.22!important;}
  .info-box small{font-size:8.2px!important;}
  .info-box strong{font-size:10.5px!important;}
}

@media print{
  @page{size:A4 portrait;margin:6mm;}
  body.page-negocios,
  body.page-negocios *{
    -webkit-print-color-adjust:exact!important;
    print-color-adjust:exact!important;
  }
  body.page-negocios{
    background:#fff!important;
    width:198mm!important;
    height:285mm!important;
    min-height:285mm!important;
    overflow:hidden!important;
    font-size:11px!important;
    line-height:1.22!important;
  }
  body.page-negocios .container{
    width:198mm!important;
    max-width:198mm!important;
    height:285mm!important;
    max-height:285mm!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
  }
  body.page-negocios .ficha{
    width:100%!important;
    height:285mm!important;
    max-height:285mm!important;
    display:flex!important;
    flex-direction:column!important;
    overflow:hidden!important;
    border:1px solid #aebed0!important;
    border-radius:8px!important;
    box-shadow:none!important;
    page-break-inside:avoid!important;
    break-inside:avoid!important;
  }
  body.page-negocios .ficha-header{
    flex:0 0 auto!important;
    padding:8px 10px!important;
    border-radius:0!important;
    min-height:0!important;
  }
  body.page-negocios .ficha-header h1{
    font-size:16px!important;
    line-height:1.08!important;
    margin:5px 0 2px!important;
    letter-spacing:-.01em!important;
  }
  body.page-negocios .ficha-header p{
    font-size:9.2px!important;
    line-height:1.15!important;
    margin:0!important;
  }
  body.page-negocios .badge-cat{
    font-size:8.6px!important;
    line-height:1!important;
    padding:4px 7px!important;
  }
  body.page-negocios .foto,
  body.page-negocios .no-foto{
    flex:0 0 56mm!important;
    width:100%!important;
    height:56mm!important;
    min-height:56mm!important;
    max-height:56mm!important;
    object-fit:contain!important;
    object-position:center center!important;
    background:#fff!important;
    border-bottom:1px solid #d8e4f2!important;
  }
  body.page-negocios .no-foto{
    display:grid!important;
    place-items:center!important;
    color:#6b7c90!important;
  }
  body.page-negocios .ficha > .p-4,
  body.page-negocios .ficha > .p-md-5{
    flex:1 1 auto!important;
    min-height:0!important;
    display:flex!important;
    flex-direction:column!important;
    padding:7px 9px 8px!important;
    overflow:hidden!important;
  }
  body.page-negocios .row.g-3{
    flex:0 0 auto!important;
    display:grid!important;
    grid-template-columns:repeat(3,1fr)!important;
    gap:5px!important;
    margin:0!important;
  }
  body.page-negocios .row.g-3 > [class*="col-"]{
    width:auto!important;
    max-width:none!important;
    padding:0!important;
  }
  body.page-negocios .row.g-3 > .col-md-12{
    grid-column:1 / -1!important;
  }
  body.page-negocios .info-box{
    padding:5px 6px!important;
    border-radius:6px!important;
    height:auto!important;
    margin:0!important;
    background:#f8fbff!important;
  }
  body.page-negocios .info-box small{
    font-size:7.8px!important;
    line-height:1.05!important;
    letter-spacing:.015rem!important;
    margin:0!important;
  }
  body.page-negocios .info-box strong{
    font-size:10px!important;
    line-height:1.12!important;
    margin-top:2px!important;
    font-weight:800!important;
  }
  body.page-negocios .map-title{
    flex:0 0 auto!important;
    font-size:11.5px!important;
    line-height:1.08!important;
    margin:7px 0 4px!important;
  }
  body.page-negocios .map-note{
    flex:0 0 auto!important;
    font-size:9px!important;
    line-height:1.15!important;
    padding:4px 6px!important;
    margin:0 0 5px!important;
    border-radius:5px!important;
  }
  body.page-negocios .map-wrap{
    flex:1 1 auto!important;
    min-height:0!important;
    height:auto!important;
    border-radius:6px!important;
    overflow:hidden!important;
    background:#f5f9ff!important;
  }
  body.page-negocios #mapaNegocioPublico{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
  }
  body.page-negocios .leaflet-control-container,
  body.page-negocios .leaflet-popup,
  body.page-negocios .no-print,
  body.page-negocios .cf-music-button,
  body.page-negocios audio#cfPublicMusic{
    display:none!important;
  }
}

/* Corrección final: centrar ficha de negocio en impresión */
@media print{
  @page{size:A4 portrait;margin:6mm;}
  html{
    width:100%!important;
    min-width:0!important;
    margin:0!important;
    padding:0!important;
    background:#fff!important;
  }
  body.page-negocios{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:285mm!important;
    min-height:285mm!important;
    margin:0!important;
    padding:0!important;
    background:#fff!important;
    overflow:hidden!important;
    display:flex!important;
    justify-content:center!important;
    align-items:flex-start!important;
  }
  body.page-negocios .container{
    flex:0 0 190mm!important;
    width:190mm!important;
    max-width:190mm!important;
    height:285mm!important;
    max-height:285mm!important;
    margin:0 auto!important;
    padding:0!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
  }
  body.page-negocios .ficha{
    width:100%!important;
    max-width:100%!important;
    height:285mm!important;
    max-height:285mm!important;
    margin:0 auto!important;
    box-sizing:border-box!important;
  }
  body.page-negocios .foto,
  body.page-negocios .no-foto{
    width:100%!important;
    display:block!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }
  body.page-negocios .map-wrap{
    width:100%!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }
}


/* Corrección definitiva: impresión de negocio centrada sin segunda hoja en blanco */
@media print{
  @page{size:A4 portrait;margin:6mm;}
  html,
  body{
    margin:0!important;
    padding:0!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:visible!important;
    background:#fff!important;
  }
  body.page-negocios{
    display:block!important;
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:visible!important;
    background:#fff!important;
  }
  body.page-negocios::before,
  body.page-negocios::after{
    content:none!important;
    display:none!important;
  }
  body.page-negocios .container{
    display:block!important;
    width:188mm!important;
    max-width:188mm!important;
    height:276mm!important;
    max-height:276mm!important;
    margin:0 auto!important;
    padding:0!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
    page-break-before:auto!important;
    page-break-after:avoid!important;
    break-before:auto!important;
    break-after:avoid!important;
  }
  body.page-negocios .ficha{
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    height:276mm!important;
    max-height:276mm!important;
    margin:0 auto!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
    page-break-inside:avoid!important;
    page-break-after:avoid!important;
    break-inside:avoid!important;
    break-after:avoid!important;
  }
  body.page-negocios .ficha-header{
    flex:0 0 auto!important;
    padding:7px 10px!important;
  }
  body.page-negocios .foto,
  body.page-negocios .no-foto{
    flex:0 0 52mm!important;
    height:52mm!important;
    min-height:52mm!important;
    max-height:52mm!important;
    object-fit:contain!important;
    object-position:center center!important;
    background:#fff!important;
  }
  body.page-negocios .ficha > .p-4,
  body.page-negocios .ficha > .p-md-5{
    flex:1 1 auto!important;
    min-height:0!important;
    padding:6px 8px 7px!important;
    display:flex!important;
    flex-direction:column!important;
    overflow:hidden!important;
  }
  body.page-negocios .row.g-3{
    gap:4px!important;
  }
  body.page-negocios .info-box{
    padding:4px 6px!important;
  }
  body.page-negocios .map-title{
    margin:5px 0 3px!important;
  }
  body.page-negocios .map-note{
    padding:3px 6px!important;
    margin:0 0 4px!important;
  }
  body.page-negocios .map-wrap{
    flex:1 1 auto!important;
    min-height:0!important;
    height:auto!important;
    overflow:hidden!important;
  }
  body.page-negocios #mapaNegocioPublico{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
  }
  body.page-negocios .no-print,
  body.page-negocios .cf-music-button,
  body.page-negocios audio,
  body.page-negocios .leaflet-control-container,
  body.page-negocios .leaflet-popup{
    display:none!important;
  }
}

/* Ajuste final de portada pública: todo visible sin desplazamiento en escritorio y botones alineados */
@media screen and (min-width: 992px){
  body.page-public-home{
    height:100vh!important;
    max-height:100vh!important;
    overflow:hidden!important;
  }
  body.page-public-home .navbar{
    min-height:58px!important;
    height:58px!important;
  }
  body.page-public-home .navbar .container{
    height:58px!important;
    padding-top:0!important;
    padding-bottom:0!important;
  }
  body.page-public-home .navbar-brand span{
    font-size:.96rem!important;
  }
  body.page-public-home .navbar-brand .fs-3{
    font-size:1.55rem!important;
  }
  body.page-public-home > .container{
    height:calc(100vh - 58px)!important;
    max-height:calc(100vh - 58px)!important;
    padding-top:8px!important;
    padding-bottom:8px!important;
    display:flex!important;
    flex-direction:column!important;
    justify-content:flex-start!important;
  }
  body.page-public-home .hero{
    flex:0 0 auto!important;
    padding:30px 30px!important;
    margin-bottom:16px!important;
    border-radius:26px!important;
  }
  body.page-public-home .hero .badge{
    font-size:.68rem!important;
    padding:.42rem .72rem!important;
    margin-bottom:.55rem!important;
  }
  body.page-public-home .hero h1{
    font-size:clamp(2rem,3.15vw,2.85rem)!important;
    line-height:1.05!important;
    margin-bottom:.55rem!important;
  }
  body.page-public-home .hero p{
    font-size:.95rem!important;
    line-height:1.38!important;
    max-width:720px!important;
  }
  body.page-public-home .row.g-4{
    flex:1 1 auto!important;
    --bs-gutter-x:1.25rem!important;
    --bs-gutter-y:1rem!important;
    align-items:stretch!important;
    margin-top:0!important;
  }
  body.page-public-home .row.g-4 > [class*="col-"]{
    display:flex!important;
  }
  body.page-public-home .access-card{
    width:100%!important;
    min-height:238px!important;
    max-height:268px!important;
    display:flex!important;
    border-radius:26px!important;
  }
  body.page-public-home .access-card .card-body{
    height:100%!important;
    min-height:0!important;
    display:flex!important;
    flex-direction:column!important;
    justify-content:flex-start!important;
    padding:22px 24px!important;
  }
  body.page-public-home .access-icon{
    flex:0 0 auto!important;
    width:58px!important;
    height:58px!important;
    border-radius:19px!important;
    font-size:1.65rem!important;
    margin:0 auto 12px!important;
  }
  body.page-public-home h4{
    min-height:1.45rem!important;
    margin-bottom:.45rem!important;
    font-size:1rem!important;
    line-height:1.2!important;
  }
  body.page-public-home .access-card p.text-muted{
    flex:1 1 auto!important;
    min-height:64px!important;
    margin-bottom:12px!important;
    font-size:.91rem!important;
    line-height:1.42!important;
  }
  body.page-public-home .access-card .btn{
    margin-top:auto!important;
    min-height:38px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    font-size:.88rem!important;
    padding:.48rem .75rem!important;
  }
  body.page-public-home .footer-note{
    display:none!important;
  }
}

@media screen and (min-width: 992px) and (max-height: 700px){
  body.page-public-home .hero{
    padding:24px 28px!important;
    margin-bottom:12px!important;
  }
  body.page-public-home .hero h1{
    font-size:clamp(1.8rem,2.8vw,2.45rem)!important;
  }
  body.page-public-home .hero p{
    font-size:.9rem!important;
  }
  body.page-public-home .access-card{
    min-height:220px!important;
  }
  body.page-public-home .access-card .card-body{
    padding:18px 22px!important;
  }
  body.page-public-home .access-icon{
    width:52px!important;
    height:52px!important;
    font-size:1.5rem!important;
    margin-bottom:10px!important;
  }
  body.page-public-home .access-card p.text-muted{
    min-height:58px!important;
    font-size:.88rem!important;
    line-height:1.36!important;
    margin-bottom:10px!important;
  }
}

/* ==========================================================
   PORTADA: ALINEACIÓN REAL DE TARJETAS Y BOTONES
   Este bloque se carga al final para prevalecer sobre reglas anteriores.
   ========================================================== */
@media screen {
  .page-public-home .home-access-grid{
    display:grid!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    gap:20px!important;
    align-items:stretch!important;
  }

  .page-public-home .home-access-grid > [class*="col-"]{
    width:auto!important;
    max-width:none!important;
    min-width:0!important;
    padding:0!important;
    display:flex!important;
  }

  .page-public-home .access-card{
    width:100%!important;
    height:100%!important;
    min-height:420px!important;
    overflow:hidden!important;
    border-radius:26px!important;
  }

  .page-public-home .access-card .card-body,
  .page-public-home .access-card .card-body.p-4{
    width:100%!important;
    min-height:420px!important;
    height:100%!important;
    padding:20px 17px!important;
    display:grid!important;
    grid-template-rows:62px 58px minmax(126px,1fr) auto!important;
    align-items:start!important;
    justify-items:stretch!important;
    gap:9px!important;
    overflow:hidden!important;
  }

  .page-public-home .access-icon{
    width:56px!important;
    height:56px!important;
    margin:0 auto!important;
    border-radius:18px!important;
    font-size:1.55rem!important;
    align-self:start!important;
  }

  .page-public-home .access-card h4{
    width:100%!important;
    max-width:100%!important;
    min-height:58px!important;
    margin:0!important;
    padding:0 2px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    text-align:center!important;
    font-size:1rem!important;
    line-height:1.16!important;
    font-weight:800!important;
    letter-spacing:-.012em!important;
    color:#10213a!important;
    overflow-wrap:anywhere!important;
  }

  .page-public-home .access-card p,
  .page-public-home .access-card p.text-muted{
    width:100%!important;
    max-width:100%!important;
    min-height:126px!important;
    margin:0!important;
    padding:0 2px!important;
    display:flex!important;
    align-items:flex-start!important;
    justify-content:center!important;
    text-align:center!important;
    font-size:.86rem!important;
    line-height:1.4!important;
    font-weight:400!important;
    color:#5c6c7f!important;
    overflow:hidden!important;
  }

  .page-public-home .access-card > .card-body > .btn,
  .page-public-home .used-actions .btn{
    width:100%!important;
    min-width:0!important;
    min-height:50px!important;
    margin:0!important;
    padding:.68rem .7rem!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:.42rem!important;
    text-align:center!important;
    font-size:.91rem!important;
    line-height:1.16!important;
    font-weight:800!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
    border-radius:13px!important;
    box-sizing:border-box!important;
  }

  .page-public-home .used-actions{
    width:100%!important;
    min-width:0!important;
    margin:0!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
    align-self:end!important;
  }

  .page-public-home .used-actions .btn{
    min-height:46px!important;
    font-size:.88rem!important;
  }
}

@media screen and (max-width:1199px){
  .page-public-home .home-access-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
  .page-public-home .access-card,
  .page-public-home .access-card .card-body,
  .page-public-home .access-card .card-body.p-4{
    min-height:400px!important;
  }
}

@media screen and (max-width:900px){
  .page-public-home .home-access-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}

@media screen and (max-width:576px){
  .page-public-home .home-access-grid{
    grid-template-columns:1fr!important;
    gap:16px!important;
  }
  .page-public-home .access-card,
  .page-public-home .access-card .card-body,
  .page-public-home .access-card .card-body.p-4{
    min-height:auto!important;
  }
  .page-public-home .access-card .card-body,
  .page-public-home .access-card .card-body.p-4{
    display:flex!important;
    flex-direction:column!important;
    padding:20px!important;
  }
  .page-public-home .access-card h4,
  .page-public-home .access-card p,
  .page-public-home .access-card p.text-muted{
    min-height:auto!important;
  }
  .page-public-home .access-card p,
  .page-public-home .access-card p.text-muted{
    margin-bottom:16px!important;
  }
  .page-public-home .access-card > .card-body > .btn,
  .page-public-home .used-actions{
    margin-top:auto!important;
  }
}

/* ==========================================================
   CORRECCIÓN DEFINITIVA DE PORTADA
   Evita que las tarjetas recorten u oculten sus botones.
   ========================================================== */
@media screen {
  body.page-public-home{
    height:auto!important;
    max-height:none!important;
    min-height:100vh!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
  }

  body.page-public-home > .container{
    height:auto!important;
    max-height:none!important;
    min-height:0!important;
    overflow:visible!important;
  }

  .page-public-home .home-access-grid{
    display:grid!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    gap:18px!important;
    align-items:stretch!important;
    overflow:visible!important;
  }

  .page-public-home .home-access-grid > [class*="col-"]{
    display:flex!important;
    width:auto!important;
    max-width:none!important;
    min-width:0!important;
    padding:0!important;
    overflow:visible!important;
  }

  .page-public-home .access-card{
    display:flex!important;
    width:100%!important;
    height:100%!important;
    min-height:408px!important;
    max-height:none!important;
    overflow:hidden!important;
    border-radius:26px!important;
  }

  .page-public-home .access-card .card-body,
  .page-public-home .access-card .card-body.p-4{
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    width:100%!important;
    height:auto!important;
    min-height:408px!important;
    max-height:none!important;
    padding:20px 16px!important;
    overflow:visible!important;
  }

  .page-public-home .access-icon{
    flex:0 0 auto!important;
    width:56px!important;
    height:56px!important;
    margin:0 auto 12px!important;
    border-radius:18px!important;
    font-size:1.55rem!important;
  }

  .page-public-home .access-card h4{
    flex:0 0 auto!important;
    width:100%!important;
    max-width:100%!important;
    min-height:52px!important;
    margin:0 0 8px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    text-align:center!important;
    font-size:1rem!important;
    line-height:1.16!important;
    font-weight:800!important;
    color:#10213a!important;
    overflow:visible!important;
  }

  .page-public-home .access-card p,
  .page-public-home .access-card p.text-muted{
    flex:0 0 auto!important;
    width:100%!important;
    max-width:100%!important;
    min-height:120px!important;
    margin:0 0 14px!important;
    padding:0!important;
    display:block!important;
    text-align:center!important;
    font-size:.86rem!important;
    line-height:1.42!important;
    font-weight:400!important;
    color:#5c6c7f!important;
    overflow:visible!important;
  }

  .page-public-home .access-card > .card-body > .btn,
  .page-public-home .used-actions .btn{
    position:relative!important;
    z-index:2!important;
    flex:0 0 auto!important;
    visibility:visible!important;
    opacity:1!important;
    width:100%!important;
    min-width:0!important;
    min-height:50px!important;
    max-height:none!important;
    margin:0!important;
    padding:.7rem .65rem!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:.42rem!important;
    text-align:center!important;
    font-size:.91rem!important;
    line-height:1.16!important;
    font-weight:800!important;
    white-space:normal!important;
    overflow:visible!important;
    border-radius:13px!important;
    box-sizing:border-box!important;
  }

  .page-public-home .access-card > .card-body > .btn{
    margin-top:auto!important;
  }

  .page-public-home .used-actions{
    position:relative!important;
    z-index:2!important;
    flex:0 0 auto!important;
    visibility:visible!important;
    opacity:1!important;
    width:100%!important;
    min-width:0!important;
    margin-top:auto!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
    overflow:visible!important;
  }

  .page-public-home .used-actions .btn{
    min-height:46px!important;
    font-size:.88rem!important;
  }
}

@media screen and (max-width:1199px) and (min-width:992px){
  .page-public-home .home-access-grid{
    gap:14px!important;
  }
  .page-public-home .access-card .card-body,
  .page-public-home .access-card .card-body.p-4{
    padding:18px 13px!important;
  }
  .page-public-home .access-card h4{
    font-size:.94rem!important;
  }
  .page-public-home .access-card p,
  .page-public-home .access-card p.text-muted{
    font-size:.81rem!important;
  }
  .page-public-home .access-card > .card-body > .btn,
  .page-public-home .used-actions .btn{
    font-size:.84rem!important;
    padding:.65rem .5rem!important;
  }
}

@media screen and (max-width:991px){
  .page-public-home .home-access-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .page-public-home .access-card,
  .page-public-home .access-card .card-body,
  .page-public-home .access-card .card-body.p-4{
    min-height:390px!important;
  }
}

@media screen and (max-width:576px){
  .page-public-home .home-access-grid{
    grid-template-columns:1fr!important;
    gap:16px!important;
  }
  .page-public-home .access-card,
  .page-public-home .access-card .card-body,
  .page-public-home .access-card .card-body.p-4{
    min-height:auto!important;
  }
  .page-public-home .access-card p,
  .page-public-home .access-card p.text-muted{
    min-height:auto!important;
    margin-bottom:16px!important;
    font-size:.94rem!important;
  }
}


/* ==========================================================
   BOTONES DE PORTADA SIEMPRE VISIBLES — VERSIÓN 20260726-7
   ========================================================== */
@media screen {
  body.page-public-home{height:auto!important;max-height:none!important;min-height:100vh!important;overflow-x:hidden!important;overflow-y:auto!important;}
  body.page-public-home > .container{height:auto!important;max-height:none!important;overflow:visible!important;}
  body.page-public-home .home-access-grid{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:18px!important;align-items:stretch!important;overflow:visible!important;}
  body.page-public-home .home-access-grid > [class*="col-"]{display:flex!important;width:auto!important;max-width:none!important;min-width:0!important;padding:0!important;overflow:visible!important;}
  body.page-public-home .access-card{display:flex!important;width:100%!important;height:100%!important;min-height:392px!important;max-height:none!important;overflow:hidden!important;}
  body.page-public-home .access-card .card-body,body.page-public-home .access-card .card-body.p-4{display:grid!important;grid-template-rows:56px 54px minmax(105px,1fr) auto!important;gap:9px!important;width:100%!important;height:100%!important;min-height:392px!important;max-height:none!important;padding:18px 15px!important;overflow:visible!important;}
  body.page-public-home .card-actions{position:relative!important;z-index:20!important;width:100%!important;display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:8px!important;align-self:end!important;visibility:visible!important;opacity:1!important;overflow:visible!important;}
  body.page-public-home .card-actions .btn{position:relative!important;z-index:21!important;width:100%!important;min-height:46px!important;max-height:none!important;margin:0!important;padding:.62rem .55rem!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:.4rem!important;visibility:visible!important;opacity:1!important;white-space:normal!important;overflow:visible!important;font-size:.88rem!important;line-height:1.15!important;font-weight:800!important;}
  body.page-public-home .used-actions .btn{min-height:43px!important;font-size:.86rem!important;}
}
@media screen and (max-width:1199px){body.page-public-home .home-access-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;}}
@media screen and (max-width:900px){body.page-public-home .home-access-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}}
@media screen and (max-width:576px){body.page-public-home .home-access-grid{grid-template-columns:1fr!important;}body.page-public-home .access-card,body.page-public-home .access-card .card-body,body.page-public-home .access-card .card-body.p-4{min-height:auto!important;}body.page-public-home .access-card .card-body,body.page-public-home .access-card .card-body.p-4{display:flex!important;flex-direction:column!important;}body.page-public-home .card-actions{margin-top:auto!important;}}
