/* Corrección de contraste limitada a botones y pies de página. */
html:not([data-theme="royal-dark"]) body :is(footer,.footer,.law-footer,.flow-footer,.legasist-contact-footer){background:#fff!important;color:#15314d!important;-webkit-text-fill-color:#15314d!important}
html:not([data-theme="royal-dark"]) body :is(footer,.footer,.law-footer,.flow-footer,.legasist-contact-footer) :is(a,p,span,small,b,strong,li,h2,h3,div){color:#15314d!important;-webkit-text-fill-color:#15314d!important}
html[data-theme="royal-dark"] body :is(footer,.footer,.law-footer,.flow-footer,.legasist-contact-footer){background:#071a32!important;color:#fff!important;-webkit-text-fill-color:#fff!important}
html[data-theme="royal-dark"] body :is(footer,.footer,.law-footer,.flow-footer,.legasist-contact-footer) :is(a,p,span,small,b,strong,li,h2,h3,div){color:#fff!important;-webkit-text-fill-color:#fff!important}
html:not([data-theme="royal-dark"]) body :is(.button.primary,.btn.primary,.dash-btn.primary,.law-btn--primary,.primary-btn,.btn-primary,.login-button,.search-submit,.professional-access-link,.payment-button,.checkout-button,.pay-button,.support-whatsapp,.contact-action.whatsapp,.contact-action.email,.submit,button[type="submit"]:not(.ghost):not(.secondary),input[type="submit"]){color:#fff!important;-webkit-text-fill-color:#fff!important;background-color:#1257a6!important;background-image:none!important;border-color:#1257a6!important}
html:not([data-theme="royal-dark"]) body :is(.button.primary,.btn.primary,.dash-btn.primary,.law-btn--primary,.primary-btn,.btn-primary,.login-button,.search-submit,.professional-access-link,.payment-button,.checkout-button,.pay-button,.support-whatsapp,.contact-action.whatsapp,.contact-action.email,.submit,button[type="submit"]:not(.ghost):not(.secondary),input[type="submit"]) :is(span,small,b,strong,i,svg){color:#fff!important;-webkit-text-fill-color:#fff!important}
html:not([data-theme="royal-dark"]) body :is(footer,.footer,.law-footer,.flow-footer,.legasist-contact-footer) :is(.button.primary,.btn.primary,.dash-btn.primary,.law-btn--primary,.primary-btn,.btn-primary,.login-button,.search-submit,.professional-access-link,.payment-button,.checkout-button,.pay-button,.support-whatsapp,.contact-action.whatsapp,.contact-action.email,.submit,button[type="submit"]:not(.ghost):not(.secondary),input[type="submit"]){color:#fff!important;-webkit-text-fill-color:#fff!important;background-color:#1257a6!important;background-image:none!important;border-color:#1257a6!important}
html:not([data-theme="royal-dark"]) body :is(footer,.footer,.law-footer,.flow-footer,.legasist-contact-footer) :is(.button.primary,.btn.primary,.dash-btn.primary,.law-btn--primary,.primary-btn,.btn-primary,.login-button,.search-submit,.professional-access-link,.payment-button,.checkout-button,.pay-button,.support-whatsapp,.contact-action.whatsapp,.contact-action.email,.submit,button[type="submit"]:not(.ghost):not(.secondary),input[type="submit"]) :is(span,small,b,strong,i,svg){color:#fff!important;-webkit-text-fill-color:#fff!important}
html[data-theme="royal-dark"] body :is(.button.primary,.btn.primary,.dash-btn.primary,.law-btn--primary,.primary-btn,.btn-primary,.login-button,.search-submit,.professional-access-link,.payment-button,.checkout-button,.pay-button,.support-whatsapp,.contact-action.whatsapp,.contact-action.email,.submit,button[type="submit"]:not(.ghost):not(.secondary),input[type="submit"]){color:#fff!important;-webkit-text-fill-color:#fff!important;background-color:#1257a6!important;background-image:none!important;border-color:#1257a6!important}
html[data-theme="royal-dark"] body :is(.button.primary,.btn.primary,.dash-btn.primary,.law-btn--primary,.primary-btn,.btn-primary,.login-button,.search-submit,.professional-access-link,.payment-button,.checkout-button,.pay-button,.support-whatsapp,.contact-action.whatsapp,.contact-action.email,.submit,button[type="submit"]:not(.ghost):not(.secondary),input[type="submit"]) :is(span,small,b,strong,i,svg){color:#fff!important;-webkit-text-fill-color:#fff!important}
html[data-theme="royal-dark"] body :is(footer,.footer,.law-footer,.flow-footer,.legasist-contact-footer) :is(.button.primary,.btn.primary,.dash-btn.primary,.law-btn--primary,.primary-btn,.btn-primary,.login-button,.search-submit,.professional-access-link,.payment-button,.checkout-button,.pay-button,.support-whatsapp,.contact-action.whatsapp,.contact-action.email,.submit,button[type="submit"]:not(.ghost):not(.secondary),input[type="submit"]){color:#fff!important;-webkit-text-fill-color:#fff!important;background-color:#1257a6!important;background-image:none!important;border-color:#1257a6!important}
html[data-theme="royal-dark"] body :is(footer,.footer,.law-footer,.flow-footer,.legasist-contact-footer) :is(.button.primary,.btn.primary,.dash-btn.primary,.law-btn--primary,.primary-btn,.btn-primary,.login-button,.search-submit,.professional-access-link,.payment-button,.checkout-button,.pay-button,.support-whatsapp,.contact-action.whatsapp,.contact-action.email,.submit,button[type="submit"]:not(.ghost):not(.secondary),input[type="submit"]) :is(span,small,b,strong,i,svg){color:#fff!important;-webkit-text-fill-color:#fff!important}
html body .support-whatsapp{background-color:#127b5b!important;border-color:#127b5b!important}
html body :is(footer,.footer,.law-footer,.flow-footer) a:not(.button):not(.professional-access-link){text-underline-offset:3px}
html body .tabs-bar .tab.active,html body .payment-tabs .payment-tab.active{background:#1257a6!important;border-color:#1257a6!important;color:#fff!important;-webkit-text-fill-color:#fff!important}
html body .tabs-bar .tab.active :is(span,b,strong),html body .payment-tabs .payment-tab.active :is(span,b,strong){color:#fff!important;-webkit-text-fill-color:#fff!important}

/* Logo legible sobre el footer claro y conservación del logo blanco en oscuro. */
html:not([data-theme="royal-dark"]) body :is(footer,.footer,.law-footer) :is(.brand-logo-img,.law-brand__logo){filter:none!important}
html[data-theme="royal-dark"] body :is(footer,.footer,.law-footer) :is(.brand-logo-img,.law-brand__logo){filter:brightness(0) invert(1)!important}

/* Dashboard de solicitantes: favoritos y solicitudes antes de herramientas. */
.user-dashboard .hero-panel{grid-template-columns:minmax(0,1fr)!important}
.user-dashboard .user-overview{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:22px;margin-top:22px;align-items:start}
.user-dashboard .user-overview>.panel{min-width:0;margin-top:0!important}
.user-dashboard .user-tools{display:grid;gap:22px;margin-top:22px}
.user-dashboard .user-tools .quick-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
@media(max-width:1100px){.user-dashboard .user-overview{grid-template-columns:minmax(0,1fr)}}
@media(max-width:680px){.user-dashboard .user-tools .quick-grid{grid-template-columns:1fr!important}}
/* Acciones legibles en modo claro, incluidas secundarias. */
html:not([data-theme="royal-dark"]) body :is(.dash-btn,.button,.btn,.law-btn,.law-btn--primary,.law-btn--secondary,.primary-btn,.btn-primary,.btn-secondary,.btn-light,.btn-outline-primary,.contact-action,button:not(.theme-toggle):not(.royal-theme-toggle),input[type="submit"],input[type="button"]){background-color:#1257a6!important;background-image:none!important;border-color:#1257a6!important;color:#fff!important;-webkit-text-fill-color:#fff!important}
html:not([data-theme="royal-dark"]) body :is(.dash-btn,.button,.btn,.law-btn,.contact-action,button,input[type="submit"]) :is(span,b,strong,small,i,svg){color:#fff!important;-webkit-text-fill-color:#fff!important}
/* Excepciones de contacto en ambos temas. */
html[data-theme] body a.contact-action.whatsapp,html:not([data-theme="royal-dark"]) body a.contact-action.whatsapp,html:not([data-theme="royal-dark"]) body a.support-whatsapp,html[data-theme="royal-dark"] body a.support-whatsapp{background:#127b5b!important;border-color:#127b5b!important;color:#fff!important;-webkit-text-fill-color:#fff!important}
html[data-theme] body a.contact-action.email,html:not([data-theme="royal-dark"]) body a.contact-action.email{background:#7039ab!important;border-color:#7039ab!important;color:#fff!important;-webkit-text-fill-color:#fff!important}
html body a.contact-action:is(.whatsapp,.email) :is(span,b,strong,small,i,svg){color:#fff!important;-webkit-text-fill-color:#fff!important}

/* Contenedores generales fluidos: 10% por lado en escritorio grande.
   El umbral evita estrechar tablets y conserva los márgenes móviles existentes. */
@media screen and (min-width:1200px){
  html body:not(.dashboard-body) :is(.container,.law-container,.legal-document,.legal-wrap){
    box-sizing:border-box!important;
    width:80%!important;
    max-width:none!important;
    margin-inline:auto!important;
  }
  html body:not(.dashboard-body) :is(.legal-document,.legal-wrap){padding-inline:0!important}
  /* Un contenedor anidado utiliza el ancho del contenedor exterior. */
  html body:not(.dashboard-body) :is(.container,.law-container,.legal-document,.legal-wrap) :is(.container,.law-container){
    width:100%!important;
    max-width:none!important;
  }
}

/* Marca compartida con index: sin tarjeta de fondo alrededor del logotipo. */
html body :is(.brand--logo,.law-brand,.dash-brand--logo,.tool-brand--logo,.footer-logo--image,.recover-brand){
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
}
html body img:is(.brand-logo-img,.law-brand__logo,.logo)[src="assets/img/legasist-logo-blue.png"],
html body .recover-brand img[src="assets/img/legasist-logo-blue.png"]{
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
}
/* Misma imagen original; blanco sobre la navegación azul para conservar contraste. */
html body .dash-sidebar img.brand-logo-img,
html body .tool-sidebar img.brand-logo-img{filter:brightness(0) invert(1)!important}

/* Contacto del perfil: prioridad sobre las reglas generales de botones. */
html body #contactar a.contact-action.whatsapp{background:#127b5b!important;background-image:none!important;border-color:#127b5b!important;color:#fff!important;-webkit-text-fill-color:#fff!important}
html body #contactar a.contact-action.email{background:#7039ab!important;background-image:none!important;border-color:#7039ab!important;color:#fff!important;-webkit-text-fill-color:#fff!important}
html body #contactar a.contact-action.whatsapp:hover{background:#0e6349!important;border-color:#0e6349!important}
html body #contactar a.contact-action.email:hover{background:#592c8b!important;border-color:#592c8b!important}
html body #contactar a.contact-action:is(.whatsapp,.email) :is(span,b,strong,small,i,svg){color:#fff!important;-webkit-text-fill-color:#fff!important}
html body #contactar a.contact-action:is(.whatsapp,.email):focus-visible{outline:3px solid #e0a829!important;outline-offset:3px}
